diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 07:25:17 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 07:25:17 +0300 |
| commit | 72d0ef912751f621d11d7d045e506904003c0b9a (patch) | |
| tree | 701e66edefbfd42dbac3993889dc35da26862a84 /crates/fparkan-runtime/src/lib.rs | |
| parent | 8a4d037791e031d4e09b5fa9093f3adf71bdb675 (diff) | |
| download | fparkan-72d0ef912751f621d11d7d045e506904003c0b9a.tar.xz fparkan-72d0ef912751f621d11d7d045e506904003c0b9a.zip | |
fix(game): stop firing when weapon ammunition runs out
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index ff0cdf69..78949222 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -17238,6 +17238,14 @@ mod tests { .map(|weapon| weapon.projectile.as_str()) .collect::<Vec<_>>(); assert_eq!(projectiles, ["bb_h_01", "bp_h_01", "bl_h_01", "bm_h_01"]); + assert_eq!( + weapons + .weapons() + .iter() + .map(player_weapon::PlayerWeapon::rounds_remaining) + .collect::<Vec<_>>(), + [Some(500), Some(150), None, Some(4)] + ); for (weapon, (speed, lifetime_ms)) in weapons.weapons().iter().zip([ (350.0, 1000), (150.0, 5000), |
