Portals - rooms_set_active needs Editor check
Calling rooms_set_active with TOOLS_ENABLED from a running project resulted in a crash because the Spatial Editor is not available. Wrapped it in an is_editor_hint.
This commit is contained in:
parent
856097d7bc
commit
f4c5092027
|
@ -510,7 +510,12 @@ void RoomManager::rooms_set_active(bool p_active) {
|
||||||
_active = p_active;
|
_active = p_active;
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
SpatialEditor::get_singleton()->update_portal_tools();
|
if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
|
SpatialEditor *spatial_editor = SpatialEditor::get_singleton();
|
||||||
|
if (spatial_editor) {
|
||||||
|
spatial_editor->update_portal_tools();
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue