diff --git a/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd b/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd index 7cd8c770..74f103e7 100644 --- a/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd +++ b/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd @@ -251,7 +251,7 @@ func _get_event_to_queue( escoria.logger.info( self, - "Checking action %s on %s..." % [action, target] + "Checking if action '%s' on '%s' is valid..." % [action, target] ) var event_to_return: ESCEvent = null @@ -360,6 +360,13 @@ func _get_event_to_queue( return event_to_return +# Runs the specified event. +# +# #### Parameters +# +# - event: the event to be run +# +# *Returns* the return code of the event once executed func _run_event(event: ESCEvent) -> int: escoria.event_manager.queue_event(event) diff --git a/addons/escoria-core/game/core-scripts/esc/esc_event_manager.gd b/addons/escoria-core/game/core-scripts/esc/esc_event_manager.gd index a292ecec..1d5c8774 100644 --- a/addons/escoria-core/game/core-scripts/esc/esc_event_manager.gd +++ b/addons/escoria-core/game/core-scripts/esc/esc_event_manager.gd @@ -284,6 +284,11 @@ func queue_background_event(channel_name: String, event: ESCEvent) -> void: # #### Parameters # - exceptions: an optional list of events which should be left running or queued func interrupt(exceptions: PoolStringArray = []) -> void: + if escoria.main.current_scene != null \ + and escoria.main.current_scene.player != null \ + and escoria.main.current_scene.player.is_moving(): + escoria.main.current_scene.player.stop_walking_now() + for channel_name in _running_events.keys(): if _running_events[channel_name] != null and not _running_events[channel_name].name in exceptions: escoria.logger.debug( diff --git a/addons/escoria-core/game/core-scripts/esc_item.gd b/addons/escoria-core/game/core-scripts/esc_item.gd index aef4384a..44fdaafd 100644 --- a/addons/escoria-core/game/core-scripts/esc_item.gd +++ b/addons/escoria-core/game/core-scripts/esc_item.gd @@ -747,3 +747,11 @@ func _get_identifier_as_key_value() -> String: return "global_id: %s" % self.global_id else: return "node: %s" % get_name() + + +# Whether the item is currently moving. +# +# *Returns* +# Returns true if the player is currently moving, false otherwise +func is_moving() -> bool: + return _movable.task != ESCMovable.MovableTask.NONE