mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
Observe settled positions in the native input regression
A paused client can retain its last velocity without moving; wait for actual position stability before measuring another owner’s movement. Co-Authored-By: OpenAI Codex <[email protected]>
This commit is contained in:
1 parent
09940babb5
commit
d884729a0e
1 file changed
+6
-2
@@ -950,8 +950,12 @@ def scenario_native_pointer():
|
||||
other = 3 - owner
|
||||
# Spectator movement decelerates after a release; measure fresh movement
|
||||
# after that inertia settles, while checking held keys independently.
|
||||
g.wait(lambda: all(abs(state(other)['player']['velocity'][i]) < 0.001 for i in [0, 2]),
|
||||
f"P{other}'s previous movement settles", seconds=5)
|
||||
def settled():
|
||||
before = state(other)['player']['position']
|
||||
time.sleep(0.15)
|
||||
after = state(other)['player']['position']
|
||||
return all(abs(after[i] - before[i]) < 0.001 for i in [0, 2])
|
||||
g.wait(settled, f"P{other}'s previous movement settles", seconds=5)
|
||||
before = [state(n)['player']['position'] for n in [1, 2]]
|
||||
native.key('w', True)
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user