Skip to content

Fixes Compatibility for AC Ammo in MHQ #6542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

psikomonkie
Copy link
Collaborator

In MekHQ, AmmoBin::isSamePartType does not properly recognize AC ammo as being the same part type. Two AC/5 ammo bins, for example. This led to any refit in MHQ for a unit that had AC ammo would show as needing changed in the refit even if nothing was changed.

In the below screenshots, nothing was changed for this unit. I right clicked the unit in the Hangar and selected customize > customize in mek lab. I made no changes to the unit before taking the screenshots.
Before Fix:
image

After Fix:
image

Copy link
Collaborator

@IllianiBird IllianiBird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find!

Copy link

codecov bot commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.28%. Comparing base (8a0e8ba) to head (dbec8a9).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #6542   +/-   ##
=========================================
  Coverage     11.27%   11.28%           
- Complexity     6316     6323    +7     
=========================================
  Files          1080     1080           
  Lines        137527   137528    +1     
  Branches      21294    21295    +1     
=========================================
+ Hits          15509    15516    +7     
  Misses       120463   120463           
+ Partials       1555     1549    -6     

☔ 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.

getType().isCompatibleWith(((AmmoBin) part).getType()) &&
(((AmmoBin) part).getFullShots() == getFullShots());
((getType().isCompatibleWith(((AmmoBin) part).getType())) ||
(getType().equals(((AmmoBin) part).getType()))) &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMFG 🥹

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, just wanted to echo Illiani's comment. That must have been super-annoying to track down.

@IllianiBird IllianiBird merged commit db9e119 into MegaMek:master Apr 4, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants