1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Explicit error message when setting active a Viewport that is already active.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
(cherry picked from commit e3be0913d7)
This commit is contained in:
TaskManagerCZ
2021-07-12 10:55:53 +02:00
committed by Rémi Verschelde
parent 9184f58dc7
commit b444bec1f3

View File

@@ -396,7 +396,7 @@ void VisualServerViewport::viewport_set_active(RID p_viewport, bool p_active) {
ERR_FAIL_COND(!viewport);
if (p_active) {
ERR_FAIL_COND(active_viewports.find(viewport) != -1); //already active
ERR_FAIL_COND_MSG(active_viewports.find(viewport) != -1, "Can't make active a Viewport that is already active.");
active_viewports.push_back(viewport);
} else {
active_viewports.erase(viewport);