Restore remote locomotion after fishing returns

This commit is contained in:
Alexander Sellite 2026-09-01 17:30:04 -04:00
parent 4196cda1d5
commit cd00f3c55e
3 changed files with 58 additions and 0 deletions

View file

@ -194,6 +194,18 @@ func _run_host() -> void:
):
await process_frame
assert(remote_avatar.is_retract_visual_complete())
var observer_cleanup_deadline: int = Time.get_ticks_msec() + 3000
while (
Time.get_ticks_msec() < observer_cleanup_deadline
and int(remote_avatar.get("_fishing_visual_phase"))
!= Player.FishingVisualPhase.NONE
):
await process_frame
assert(
int(remote_avatar.get("_fishing_visual_phase"))
== Player.FishingVisualPhase.NONE
)
assert(remote_animation_player.assigned_animation != &"retract_sit")
# Give the client that owns the same presentation a frame boundary to finish
# local cleanup before the host intentionally tears down this test session.
for _frame: int in 4:

View file

@ -545,6 +545,35 @@ func _validate_remote_presentation() -> void:
presentation.synchronize_active("late-attempt", target, false)
assert(not bool(player.get("_fighting_visual_active")))
# An escape or withdrawal has no showcase to clear the retract pose. Return
# completion itself must restore ordinary locomotion before listeners dispose
# of the observer presentation.
presentation.play_return()
await presentation.return_completed
assert(
int(player.get("_fishing_visual_phase"))
== Player.FishingVisualPhase.NONE
)
assert(not bool(player.get("_fighting_visual_active")))
player.set_physics_process(false)
player.velocity = Vector3(8.0, 0.0, 0.0)
player.call("_update_character_animation")
var animation_player := player.get_node(
"Visuals/CharacterRig/AnimationPlayer"
) as AnimationPlayer
assert(animation_player.assigned_animation == &"running")
var running_position: float = animation_player.current_animation_position
await create_timer(0.1).timeout
assert(animation_player.current_animation == &"running")
assert(
not is_equal_approx(
animation_player.current_animation_position,
running_position,
)
)
presentation.cleanup()
presentation.synchronize_active("catch-attempt", target, false)
var fish_catch := FishCatchType.new()
var fish: FishData = PondPool.candidates.front()
fish_catch.fish = fish