diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d4e86fe..c2b891be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [4.0.0-alpha.180](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.180) (2022-05-02) + + +### Bug Fixes + +* prevents the same event from being queued multiple times in a row ([0468817](https://github.com/godot-escoria/escoria-demo-game/commit/046881781285767ea911046c48a1eb60b4fabc4b)) + + + ## [4.0.0-alpha.179](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.179) (2022-05-01) 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 4b664019..d561c8ff 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 @@ -205,9 +205,9 @@ func queue_event(event: ESCEvent) -> void: escoria.logger.debug(message % [event.name, CHANNEL_FRONT]) return elif _is_event_running(event, CHANNEL_FRONT): - # Don't queue the same event if it's already running. + # Don't queue the same event if it's already running. escoria.logger.debug( - "Event %s already running in channel '%s'. Won't be queued." + "Event %s already running in channel '%s'. Won't be queued." % [event.name, CHANNEL_FRONT] ) @@ -248,9 +248,9 @@ func queue_background_event(channel_name: String, event: ESCEvent) -> void: escoria.logger.debug(message % [event.name, channel_name]) return elif _is_event_running(event, CHANNEL_FRONT): - # Don't queue the same event if it's already running. + # Don't queue the same event if it's already running. escoria.logger.debug( - "Event %s already running in channel '%s'. Won't be queued." + "Event %s already running in channel '%s'. Won't be queued." % [event.name, channel_name] ) @@ -370,5 +370,5 @@ func _get_last_event_queued(channel_name: String) -> ESCEvent: # *Returns* true iff event is currently running in the specified channel. func _is_event_running(event: ESCEvent, channel_name: String) -> bool: var running_event: ESCEvent = get_running_event(channel_name) - + return running_event != null and running_event.name == event.name