Fix incorrect signal connection on the hook

The signal should be one shot as it is the trigger to get out of the hook's fire
state. I also moved the signal as the cooldown timer doesn't start if the player
is not using the hook on a target.
This commit is contained in:
Nathan Lovato 2020-01-11 17:23:45 +01:00
parent 9e1797dd3a
commit a281242b16

View file

@ -6,8 +6,6 @@ func _on_Cooldown_timeout() -> void:
func enter(msg: Dictionary = {}) -> void:
owner.cooldown.connect("timeout", self, "_on_Cooldown_timeout")
owner.is_aiming = false
var target: HookTarget = owner.snap_detector.target
@ -20,10 +18,7 @@ func enter(msg: Dictionary = {}) -> void:
owner.arrow.hook_position = target.global_position
target.hooked_from(owner.global_position)
owner.cooldown.connect("timeout", self, "_on_Cooldown_timeout", [], CONNECT_ONESHOT)
owner.cooldown.start()
owner.emit_signal("hooked_onto_target", target.global_position)
func exit() -> void:
owner.cooldown.disconnect("timeout", self, "_on_Cooldown_timeout")