8000 Fix #4801: Fixed Infantry Capacity Calculation in Transport Report by IllianiBird · Pull Request #6747 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix #4801: Fixed Infantry Capacity Calculation in Transport Report #6747

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

Conversation

IllianiBird
Copy link
Collaborator
  • Resolved incorrect calculation of infantry capacity in Unit.java.

Fix #4801

- Resolved incorrect calculation of infantry capacity in `Unit.java`.
@IllianiBird IllianiBird added Bug GUI Severity: Low Issues described as low severity as per the new issue form labels Apr 23, 2025
@IllianiBird IllianiBird self-assigned this Apr 23, 2025
Copy link
codecov bot commented Apr 23, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 11.40%. Comparing base (1702c4a) to head (3f9ed5d).
Report is 28 commits behind head on master.

Files with missing lines Patch % Lines
MekHQ/src/mekhq/campaign/unit/Unit.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #6747   +/-   ##
=========================================
  Coverage     11.40%   11.40%           
- Complexity     6477     6478    +1     
=========================================
  Files          1095     1095           
  Lines        140888   140888           
  Branches      21841    21841           
=========================================
+ Hits          16069    16070    +1     
  Misses       123160   123160           
+ Partials       1659     1658    -1     

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

@HammerGS HammerGS requested a review from Copilot April 24, 2025 01:14
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue with the infantry capacity calculation in the transport report by updating the logic to divide each bay's capacity by the platoon weight.

  • Fixed calculation logic in getInfantryCapacity
  • Reordered the import for CrewType
Comments suppressed due to low confidence (1)

MekHQ/src/mekhq/campaign/unit/Unit.java:2071

  • Ensure that getPlatoonType().getWeight() is never zero to avoid potential division by zero errors. Consider adding a check or safeguard if this possibility exists.
bays += bay.getCapacity() / ((InfantryBay) bay).getPlatoonType().getWeight();

@HammerGS HammerGS merged commit 43509d1 into MegaMek:master Apr 24, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug GUI Severity: Low Issues described as low severity as per the new issue form
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[0.50]: Infantry Bay Calculation for Transport Report is Incorrect, Multiplied by 5
2 participants
0