fix: add code to handle scenes run directly from the Godot editor and allow for the current room to be set in the object manager, allowing proper setup

This commit is contained in:
Duncan Brown authored and Julian Murgia committed 2022-04-08 21:18:57 +02:00
1 parent 2508786cde
commit c87e853ba6
3 files changed
+22 -3

No files matched your search

@@ -317,12 +317,13 @@ func unregister_object(object: ESCObject, room_key: ESCRoomObjectsKey) -> void:
"ESCObjectManager:unregister_object()",
[
"Unable to unregister object.",
"Object with global ID %s room (%s, %s) not found." %
"Object with global ID %s room (%s, %s) not found. If this was" %
[
"?" if object == null else object.global_id,
room_key.room_global_id,
room_key.room_instance_id
]
],
"part of a 'forced' registration, ignore this warning."
]
)
@@ -205,7 +205,10 @@ func error(string: String, args = [], do_savegame: bool = true):
_log(message, true)
escoria.set_game_paused(true)
escoria.main.current_scene.game.show_crash_popup(files_to_send)
if is_instance_valid(escoria.main.current_scene):
escoria.main.current_scene.game.show_crash_popup(files_to_send)
assert(false)