Skip to content
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

Expanded and Fixed Cargo Capacity Logic #5673

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

IllianiCBT
Copy link
Collaborator

  • Included Refrigerated, and Insulated cargo bays in the capacity calculation.
  • Updated coverage for misc capacity by using Mounted rather than string comparison. This should make it a lot more durable to change. This should fix [50.02] ClassCastException on manuel game resolve #5648, however as that appears to be a localization issue I cannot be certain.
  • Updated calculations to better account for damaged and location destruction.

Extracted and centralized cargo capacity parsing into a dedicated method to improve code clarity and reusability. Updated patterns and logic to account for edge cases, including localization variations. Enhanced error handling and logging for parsing issues.
Replaced repeated `Math.max` calls with static imports for better readability. Refactored `getCargoCapacity` to improve clarity and accuracy by simplifying logic and removing redundant code. The changes streamline computations and enhance maintainability.
@IllianiCBT IllianiCBT added the Bug label Jan 6, 2025
@IllianiCBT IllianiCBT self-assigned this Jan 6, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.03%. Comparing base (be04339) to head (d4d88a5).
Report is 61 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5673   +/-   ##
=========================================
  Coverage     10.02%   10.03%           
- Complexity     6067     6072    +5     
=========================================
  Files          1074     1074           
  Lines        141598   141664   +66     
  Branches      20645    20654    +9     
=========================================
+ Hits          14201    14216   +15     
- Misses       126024   126076   +52     
+ Partials       1373     1372    -1     

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

@HammerGS HammerGS merged commit 91a5929 into MegaMek:master Jan 7, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[50.02] ClassCastException on manuel game resolve
3 participants