fix: prevents changing scenes to the same scene as is current (#619)

This commit is contained in:
Duncan Brown
2022-08-09 15:48:57 -04:00
committed by GitHub
parent 6ccede06a4
commit 6a223ca199

View File

@@ -53,6 +53,13 @@ func register_reserved_globals() -> void:
# - enable_automatic_transitions: Whether to play the transition between rooms
# automatically or to leave the responsibility to the developer.
func change_scene(room_path: String, enable_automatic_transitions: bool) -> void:
if escoria.main and escoria.main.current_scene and escoria.main.current_scene.filename == room_path:
escoria.logger.info(
self,
"Attempting to change scene to same scene as the current scene. Aborting."
)
return
# We're changing scenes, so users shouldn't be able to do stuff during.
escoria.inputs_manager.input_mode = escoria.inputs_manager.INPUT_NONE