fix(multiball): start completed panel on type-three reset
The original reset helper checks contact words 129 through 133 and starts the DAT600 panel whenever all five are nonzero. This matters after the fifth lock is captured during multiball: the panel is initially deferred, but a later single-ball type-three reset, including record 148, starts it even without a second lock-hole award. Rust only started the panel from its lock completion helper. Mirror the five-contact gate in the shared type-three launcher reset. Extend the multiball completion regression to prove both the special-hole reset path and the separately capped survivor recapture path. Test Plan: - `cargo test --workspace --all-targets --all-features` -- 124 passed - `cargo clippy --workspace --all-targets --all-features -- -D warnings` -- passed - `rumdl check --flavor commonmark RECONSTRUCTION.md CHANGELOG.md` -- passed - `git diff --cached --check` -- passed
This commit is contained in:
@@ -1882,6 +1882,12 @@ impl Game {
|
||||
}
|
||||
|
||||
fn reset_ball_to_launcher(&mut self) {
|
||||
if self.record_contacts[129..=133]
|
||||
.iter()
|
||||
.all(|contact| *contact != 0)
|
||||
{
|
||||
self.panel_frame = Some(0);
|
||||
}
|
||||
self.ball = Ball::default();
|
||||
self.launcher_charge = 0.0;
|
||||
self.launcher_was_down = false;
|
||||
@@ -4074,6 +4080,7 @@ mod tests {
|
||||
fn fifth_multiball_lock_defers_panel_and_caps_survivor_reaward() {
|
||||
let mut game = Game::new(1);
|
||||
game.wheel_holes = [true, true, true, true, false];
|
||||
game.record_contacts[129..=133].fill(2);
|
||||
game.players[0].secondary_score = 150_000;
|
||||
game.score_mode = ScoreMode::Multiball;
|
||||
let mut events = Vec::new();
|
||||
@@ -4087,6 +4094,10 @@ mod tests {
|
||||
assert_eq!(game.player().score_multiplier, 2);
|
||||
assert_eq!(game.panel_frame, None);
|
||||
|
||||
let mut reset_by_special_hole = game.clone();
|
||||
reset_by_special_hole.reset_ball_to_launcher();
|
||||
assert_eq!(reset_by_special_hole.panel_frame, Some(0));
|
||||
|
||||
game.score_mode = ScoreMode::Normal;
|
||||
assert_eq!(
|
||||
game.complete_lock_hole(4, 1, &mut events),
|
||||
|
||||
Reference in New Issue
Block a user