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

Fix Track Calculation in StratconContractInitializer #5143

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

IllianiCBT
Copy link
Collaborator

Changed minimum number of tracks from 1 to 0 when initializing contracts. This adjustment ensures that the number of tracks properly reflects contracts requiring fewer lances, preventing erroneous excess tracks.

This fixes a misunderstanding in #5091. Seeing a variable called numTracks I mistakenly thought it was the number of tracks, instead it's the maximum track index. Mea culpa.

Changed minimum number of tracks from 1 to 0 when initializing contracts. This adjustment ensures that the number of tracks properly reflects contracts requiring fewer lances, preventing erroneous excess tracks.
Renamed `numTracks` to `maximumTrackIndex` for clarity and changed the loop variable `x < numTracks` to `x < maximumTrackIndex`. This improves code readability and better reflects the purpose of the variables.
@IllianiCBT IllianiCBT added Bug StratCon Bugs relating strictly to StratCon labels Oct 28, 2024
@IllianiCBT IllianiCBT self-assigned this Oct 28, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.53%. Comparing base (fb6c52a) to head (a8e0e44).
Report is 32 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5143      +/-   ##
============================================
- Coverage     10.53%   10.53%   -0.01%     
+ Complexity     6041     6040       -1     
============================================
  Files           956      956              
  Lines        134253   134264      +11     
  Branches      19501    19506       +5     
============================================
+ Hits          14142    14143       +1     
- Misses       118760   118769       +9     
- Partials       1351     1352       +1     

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

@HammerGS HammerGS merged commit d00c8d6 into MegaMek:master Oct 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug StratCon Bugs relating strictly to StratCon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants