Fix #9053: one-shot weapon cannot be fired after reloading, except if game is saved and reloaded#9112
Merged
IllianiBird merged 3 commits intoMay 27, 2026
Conversation
IllianiBird
approved these changes
May 27, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9112 +/- ##
============================================
- Coverage 15.22% 15.21% -0.01%
- Complexity 9319 9343 +24
============================================
Files 1304 1308 +4
Lines 172662 173420 +758
Branches 26061 26220 +159
============================================
+ Hits 26287 26386 +99
- Misses 143328 143959 +631
- Partials 3047 3075 +28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We keep the OS launcher weapons mounted to their entities, and we never unset
firedon One-Shot weapons during the game... so we never unsetfiredon OS weapons, period.This adds a step to try to unset the
firedstate on all weapons when their ammo is reloaded.Doing so is fine as all ammo-based weapons need
setFired(false)before the next scenario, it's just that this is usually handled within the MegaMek client for non-OS weapons.If, for some reason, the linking weapon for a bin can't be found, we'll print an error message.
Testing:
Fix #9053