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

Added Academy Validation when Loading Existing Save #4380

Merged
merged 4 commits into from
Jul 14, 2024

Conversation

IllianiCBT
Copy link
Collaborator

MekHQ will now validate all in-use academies when the campaign XML is parsed. If an academy used in the campaign is not valid, an error is thrown and an error message is shown.

image

Closes #4352

MekHQ will now validate all in-use academies when the campaign XML is parsed. If an academy used in the campaign is not valid, an error is thrown and a corresponding error message is shown.
@IllianiCBT IllianiCBT added the Bug label Jul 11, 2024
@IllianiCBT IllianiCBT self-assigned this Jul 11, 2024
The PlanetarySystem and Planet import declarations in CampaignXmlParser.java were removed. These were not used in the class and deemed unnecessary, thus helping clean up the code and improve readability.
@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.27%. Comparing base (f7bd31c) to head (ca1de0a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4380      +/-   ##
============================================
- Coverage     10.27%   10.27%   -0.01%     
  Complexity     5811     5811              
============================================
  Files           925      925              
  Lines        126031   126046      +15     
  Branches      18627    18633       +6     
============================================
  Hits          12945    12945              
- Misses       111811   111826      +15     
  Partials       1275     1275              

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

IllianiCBT and others added 2 commits July 13, 2024 19:27
The check for the existence of an academy in a set was optimized in the CampaignXmlParser class. Additionally, redundant conditionals when adding missing academies to the list were eliminated, and unnecessary repetitive code was simplified for clarity and efficiency.
@IllianiCBT IllianiCBT merged commit a27032f into MegaMek:master Jul 14, 2024
3 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.

[NPE/RFE] Null pointer exception advancing the day when custom academies are missing
3 participants