tests: assert players stay on the floor in the game-flow multiplayer test too
checkpoint / checkpoint (push) Successful in 1m33s

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015jtxAiu5dAW4WxCNdGkrkJ
This commit is contained in:
2026-09-05 22:59:58 +00:00
parent 7ccdd3063a
commit bd1bdc417a
+11 -5
View File
@@ -59,13 +59,19 @@ func _run() -> void:
await process_frame await process_frame
quit(0); return 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 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 start: Vector3 = player.global_position
var max_remotes := 0 var max_remotes := 0
for i in 120: for i in 120:
# Drive the player forward by faking held input. player._input_direction = Vector2(0, 1) # fake held forward
player._input_direction = Vector2(0, 1)
await process_frame await process_frame
var n := 0 var n := 0
for c in game.get_children(): for c in game.get_children():
@@ -73,5 +79,5 @@ func _run() -> void:
n += 1 n += 1
max_remotes = maxi(max_remotes, n) max_remotes = maxi(max_remotes, n)
var moved: bool = player.global_position.distance_to(start) > 1.0 var moved: bool = player.global_position.distance_to(start) > 1.0
print("RESULT a remotes=%d moved=%s" % [max_remotes, str(moved)]) 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) else 1) quit(0 if (moved and max_remotes >= 1 and on_floor) else 1)