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: Tank armor and invalid builds #6343

Merged
merged 3 commits into from
Jan 2, 2025

Conversation

Scoppio
Copy link
Collaborator

@Scoppio Scoppio commented Jan 2, 2025

Fixes issue MegamekLab #1674.

It makes sure the correct armor tech level is loaded when loading the tank or SV.
It also makes sure the correct tech level is persisted when saving the non-mek entity.

This also adds a list of reasons/justifications to why a canon unit build is invalid, and allows it to be loaded.
If the unit is changed in a way to make it lose its canon status (change the MUL to -1 or change the name to something that is not in the canon names list) it will stop saving the reasons list for the build fail.

Also adds a bulk file verification test for all units in MegaMek.

Fixes:

  • SV and Tank patchwork (IS and Clan)
  • SV and Tank high tech armor level and rating (IS and Clan)

Implements:

  • Build specific tag for canon units with the reason for failing build (only for BLK files)
  • The invalid build reason tags are lost when making custom units derived from canon units (only for BLK files)

Example of use in a BLK file:


<invalidSourceBuildReasons>
UNIT_OLDER_THAN_EQUIPMENT_INTRO_YEAR
</invalidSourceBuildReasons>

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.98%. Comparing base (957e8e5) to head (243b211).
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #6343   +/-   ##
=========================================
  Coverage     28.97%   28.98%           
- Complexity    14087    14089    +2     
=========================================
  Files          2673     2674    +1     
  Lines        269472   269480    +8     
  Branches      47967    47968    +1     
=========================================
+ Hits          78087    78103   +16     
+ Misses       187402   187397    -5     
+ Partials       3983     3980    -3     

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

@Scoppio Scoppio force-pushed the fix/sv-armor-rating-and-level branch from a111eb3 to fbebf76 Compare January 2, 2025 21:24
@Scoppio Scoppio force-pushed the fix/sv-armor-rating-and-level branch from fbebf76 to 957e8e5 Compare January 2, 2025 21:30
@Scoppio Scoppio marked this pull request as ready for review January 2, 2025 21:36
@Scoppio Scoppio self-assigned this Jan 2, 2025
@Scoppio Scoppio added the Bug label Jan 2, 2025
Copy link
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

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

Looks great; this will be a godsend.

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.

2 participants