From ebe999a93ce7a652fa12bc3659320a41eaa6ceeb Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Sun, 18 Jun 2023 19:50:37 -0400 Subject: [PATCH] fix the player jump double-up issue, make sure compound states do not enter a child state twice if they are the default (fixes #119) --- addons/godot_state_charts/compound_state.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/godot_state_charts/compound_state.gd b/addons/godot_state_charts/compound_state.gd index 3ea7d13..9f20f5e 100644 --- a/addons/godot_state_charts/compound_state.gd +++ b/addons/godot_state_charts/compound_state.gd @@ -56,6 +56,9 @@ func _handle_transition(transition: Transition, source: State) -> void: push_error("the target state: %s of transition from state: %s is not a state" % [str(transition.to), source.name]) return + if target.active: + return + # if direct child, just switch active state if target in get_children(): # deactivate current state