Manage save game in case of room loading failure (#441)
This commit is contained in:
@@ -70,7 +70,8 @@ func get_save_data() -> Dictionary:
|
||||
save_data["interactive"] = self.interactive
|
||||
save_data["state"] = self.state
|
||||
|
||||
if self.node.get("is_movable") and self.node.is_movable:
|
||||
if is_instance_valid(self.node) and \
|
||||
self.node.get("is_movable") and self.node.is_movable:
|
||||
save_data["global_transform"] = self.node.global_transform
|
||||
save_data["last_deg"] = wrapi(self.node._movable._get_angle() + 1, 0, 360)
|
||||
save_data["last_dir"] = self.node._movable.last_dir
|
||||
|
||||
@@ -180,7 +180,8 @@ func perform_script_events():
|
||||
)
|
||||
escoria.globals_manager.set_global(
|
||||
"ESC_LAST_SCENE",
|
||||
escoria.main.current_scene.global_id,
|
||||
escoria.main.current_scene.global_id \
|
||||
if escoria.main.current_scene != null else "",
|
||||
true
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user