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.
This commit is contained in:
ddidderr committed 2026-10-10 11:46:00 +02:00
1 parent 0e8121d027
commit 17a7b3c328
3 files changed
+39

No files matched your search

+3
View File
@@ -88,6 +88,9 @@ differences follow from treating every ball alike:
- The release-ball effect (effect seven) frees a parked special-hole ball
whenever one is parked, not only when exactly one ball is in play. The
released ball owns the hole's contact under its own slot number.
- The claw re-targets a shooter-lane release (terminal frame 18) to a table
release whenever more than one ball is in play during its ride, not only
when the capture began in multiball.
- High-score entries carry a `crazy` flag that both local storage and the
shared service persist; older entries default to normal scores.