Restore remote locomotion after fishing returns
This commit is contained in:
parent
4196cda1d5
commit
cd00f3c55e
3 changed files with 58 additions and 0 deletions
|
|
@ -57,6 +57,10 @@ func show_cast(
|
|||
):
|
||||
return
|
||||
_kill_cast_tween()
|
||||
# A previous attempt can finish its fighting presentation immediately before
|
||||
# a replacement cast is reconstructed. Reset the owning avatar as well as our
|
||||
# local bookkeeping so fighting cannot continue to outrank the release pose.
|
||||
_owner.set_fighting_visual(false)
|
||||
_active = true
|
||||
_attempt_id = attempt_id
|
||||
_observer_fighting_active = false
|
||||
|
|
@ -256,6 +260,7 @@ func _on_return_finished() -> void:
|
|||
_showcase_tween.tween_interval(2.5)
|
||||
_showcase_tween.finished.connect(_on_showcase_finished)
|
||||
return
|
||||
_restore_owner_after_return()
|
||||
return_completed.emit()
|
||||
|
||||
|
||||
|
|
@ -271,6 +276,18 @@ func _on_showcase_put_away_finished() -> void:
|
|||
return_completed.emit()
|
||||
|
||||
|
||||
func _restore_owner_after_return() -> void:
|
||||
# Return completion owns the transition out of the observer-only fishing
|
||||
# poses. This must happen before completion listeners queue_free this node;
|
||||
# otherwise an escape or withdrawal leaves RETRACT selected indefinitely and
|
||||
# masks every later locomotion animation on this observer.
|
||||
_observer_fighting_active = false
|
||||
if _owner == null or not is_instance_valid(_owner):
|
||||
return
|
||||
_owner.set_fighting_visual(false)
|
||||
_owner.set_fishing_visual(false)
|
||||
|
||||
|
||||
func _kill_cast_tween() -> void:
|
||||
if _cast_tween != null and _cast_tween.is_valid():
|
||||
_cast_tween.kill()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue