Skip to content

Commit

Permalink
fix: prevents changing scenes to the same scene as is current (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
BHSDuncan authored Aug 9, 2022
1 parent 6ccede0 commit 6a223ca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6a223ca

Please sign in to comment.