From bd1bdc417a53754db9b90f96857b167a5068ed98 Mon Sep 17 00:00:00 2001 From: daddy Date: Sat, 5 Sep 2026 22:59:58 +0000 Subject: [PATCH] tests: assert players stay on the floor in the game-flow multiplayer test too Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_015jtxAiu5dAW4WxCNdGkrkJ --- scripts/mp_game_flow_client.gd | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/mp_game_flow_client.gd b/scripts/mp_game_flow_client.gd index 36fe0ff..4dbf535 100644 --- a/scripts/mp_game_flow_client.gd +++ b/scripts/mp_game_flow_client.gd @@ -59,13 +59,19 @@ func _run() -> void: await process_frame quit(0); return - # role a: move and look for a remote node. + # role a: hold still briefly (confirm we don't fall through the floor), + # then move and look for a remote node. var player = game.get_node("Player") + var min_y := 1000.0 + for i in 30: + await process_frame + min_y = minf(min_y, player.global_position.y) + var on_floor: bool = min_y > -3.0 + var start: Vector3 = player.global_position var max_remotes := 0 for i in 120: - # Drive the player forward by faking held input. - player._input_direction = Vector2(0, 1) + player._input_direction = Vector2(0, 1) # fake held forward await process_frame var n := 0 for c in game.get_children(): @@ -73,5 +79,5 @@ func _run() -> void: n += 1 max_remotes = maxi(max_remotes, n) var moved: bool = player.global_position.distance_to(start) > 1.0 - print("RESULT a remotes=%d moved=%s" % [max_remotes, str(moved)]) - quit(0 if (moved and max_remotes >= 1) else 1) + print("RESULT a remotes=%d moved=%s on_floor=%s" % [max_remotes, str(moved), str(on_floor)]) + quit(0 if (moved and max_remotes >= 1 and on_floor) else 1)