fix: prevents changing scenes to the same scene as is current (#619)
This commit is contained in:
1 parent
6ccede06a4
commit
6a223ca199
1 file changed
+7
@@ -53,6 +53,13 @@ func register_reserved_globals() -> void:
|
|||||||
# - enable_automatic_transitions: Whether to play the transition between rooms
|
# - enable_automatic_transitions: Whether to play the transition between rooms
|
||||||
# automatically or to leave the responsibility to the developer.
|
# automatically or to leave the responsibility to the developer.
|
||||||
func change_scene(room_path: String, enable_automatic_transitions: bool) -> void:
|
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.
|
# We're changing scenes, so users shouldn't be able to do stuff during.
|
||||||
escoria.inputs_manager.input_mode = escoria.inputs_manager.INPUT_NONE
|
escoria.inputs_manager.input_mode = escoria.inputs_manager.INPUT_NONE
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user