Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Sleet01
Copy link
Collaborator

@Sleet01 Sleet01 commented May 29, 2025

During the damageEntity() refactoring process, I skipped over a call to destroyEntity() in the new Battle Armor-specific function.
Originally it was gated behind a check for !engineExplosion and looked like it only applied to Meks and Vehicles, so I removed it.

This caused MegaMek to hang when attempting to destroy BA units because the rollForHitLocation() method would infinitely loop, trying to find the next location to destroy even after all troopers were killed.

Let this be a lesson: Always Destroy Battle Armor!

Patch also adds the ability to load recent nightly saves into the dev code of the same version (but not to or from releases).

Testing:

  • Ran repo game with fixes
  • Added a new unit test to confirm correct behaviour in both damage managers
  • Ran all 3 projects' unit tests

Close #7159
Close #7160

@Sleet01 Sleet01 requested a review from a team as a code owner May 29, 2025 08:21
@codecov
Copy link

codecov bot commented May 29, 2025

Codecov Report

Attention: Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 30.64%. Comparing base (c7d9cad) to head (a913775).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...ek/src/megamek/client/ui/clientGUI/MegaMekGUI.java 0.00% 6 Missing ⚠️
megamek/src/megamek/common/BattleArmor.java 0.00% 0 Missing and 1 partial ⚠️
...megamek/server/totalwarfare/TWPhaseEndManager.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7169      +/-   ##
============================================
- Coverage     30.67%   30.64%   -0.03%     
+ Complexity    17127    17121       -6     
============================================
  Files          2968     2968              
  Lines        289606   289614       +8     
  Branches      50483    50488       +5     
============================================
- Hits          88829    88750      -79     
- Misses       194130   194263     +133     
+ Partials       6647     6601      -46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sleet01 Sleet01 merged commit e4de58d into MegaMek:master May 29, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants