ddidderr 17a7b3c328 fix(divergence): keep claw releases on the table during multiball
Bug: with several balls in play the claw could still drop its ball into
the shooter lane (terminal frame 18), sending it back to the launcher.

Cause: the restriction to table releases (frames 1, 6, 7) is latched
when the ball enters the claw's capture zone, from the ball count at
that moment. Balls added afterwards (crazy mode, a release-ball spawn)
did not affect a capture that had already chosen frame 18.

Fix: while the claw holds a ball and is heading for frame 18,
update_claw checks the live ball count every timer callback. With more
than one ball (the held one included) it re-targets the claw to a
random table frame using the same restricted draw as a multiball
capture. The claw animates one frame per callback, so it simply turns
around towards the new target.

Single-ball captures, and multiball captures that were already
restricted at entry, behave exactly as before; the extra random draw only
happens in the situation that used to misbehave.

Test Plan:
- cargo test claw_never_drops_into_the_shooter_lane_with_several_balls:
  a frame-18 capture gains a second ball mid-ride and must release at
  frame 1, 6, or 7, onto the table.
- A release-mode stress run (40 two-player crazy-mode games) counted 254
  claw releases and none into the shooter lane with several balls.
2026-10-10 11:46:00 +02:00
S
Description
No description provided
13 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 73.2%
Rust 14.6%
C++ 5%
Python 4.1%
Shell 1.4%
Other 1.6%