From 860c6adc207bfbc80877dac731005d351e93824b Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Tue, 23 Nov 2021 22:11:58 +0100 Subject: [PATCH] fix: Fixes signal handling on AnimationPlayer nodes. (#458) Co-authored-by: Dennis Ploeger --- .../game/core-scripts/esc_animation_player.gd | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/addons/escoria-core/game/core-scripts/esc_animation_player.gd b/addons/escoria-core/game/core-scripts/esc_animation_player.gd index 93deafff..f3df06e6 100644 --- a/addons/escoria-core/game/core-scripts/esc_animation_player.gd +++ b/addons/escoria-core/game/core-scripts/esc_animation_player.gd @@ -80,12 +80,19 @@ func play(name: String, backwards: bool = false): self, "_on_animation_finished" ) - _player_node.connect( - "animation_finished", - self, - "_on_animation_finished", - [name] - ) + if _is_animation_player: + _player_node.connect( + "animation_finished", + self, + "_on_animation_finished" + ) + else: + _player_node.connect( + "animation_finished", + self, + "_on_animation_finished", + [name] + ) if backwards and _is_animation_player: _animation_player.play_backwards(name) elif backwards: