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

Reworked AtB Bonus Rolls, Fixed Bug in Bulk Hire #4931

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

IllianiCBT
Copy link
Collaborator

Requires #4928

Removed random civilian, apc, and free recruit rolls from AtB Bonus table. Replaced with free Veteran MekWarrior (Ronin), free tank, free aerospace fighter, and free mek.

Fixed a bug in bulk hire that caused SPAs to not be generated if fixed age wasn't enabled.

Removed random civilian, apc, and free recruit rolls from AtB Bonus table. Replaced with free Veteran MekWarrior (Ronin), free tank, free aerospace fighter, and free mek.

Fixed a bug in bulk hire that caused SPAs to not be generated if fixed age wasn't enabled.
@IllianiCBT IllianiCBT added Bug AtB Personnel Personnel-related Issues labels Sep 28, 2024
@IllianiCBT IllianiCBT self-assigned this Sep 28, 2024
actualUnitType = UnitType.TANK;
// Mixed units randomly select between Mek or ground vehicle
} else {
for (int x = 0; x < unitCount; x++) {

Check warning

Code scanning / CodeQL

Constant loop condition Warning

Loop
might not terminate, as this loop condition is constant within the loop.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it will

Collection<MissionRole> roles;

if (rolesByType != null) {
roles = rolesByType.getOrDefault(unitTypes.get(i), new ArrayList<>());

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
rolesByType
may be null at this access as suggested by
this
null guard.
Variable
rolesByType
may be null at this access because of
this
null argument.
Variable
rolesByType
may be null at this access because of this null argument.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The null check is right there

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.44%. Comparing base (90ea1b7) to head (ea356d4).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #4931   +/-   ##
=========================================
  Coverage     10.44%   10.44%           
- Complexity     5998     6007    +9     
=========================================
  Files           951      951           
  Lines        132874   132922   +48     
  Branches      19329    19343   +14     
=========================================
+ Hits          13873    13885   +12     
- Misses       117653   117691   +38     
+ Partials       1348     1346    -2     

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

Removed the `campaign` parameter from the `reRollLoyalty` method as it was redundant and unused. This change reduces the complexity of calls to this method in `AtBContract.java` and `HireBulkPersonnelDialog.java`.
A random callsign is now generated for new Ronin characters during their recruitment process. This change improves the immersion and uniqueness of each Ronin by providing them with automatically generated, random callsigns.
@HammerGS
Copy link
Member

HammerGS commented Oct 2, 2024

@IllianiCBT Has conflicting files now.

# Conflicts:
#	MekHQ/src/mekhq/campaign/mission/AtBContract.java
#	MekHQ/src/mekhq/campaign/mission/AtBDynamicScenarioFactory.java
Consolidated and refactored import statements in AtBContract and AtBDynamicScenarioFactory. Replaced hardcoded values with constants and centralized imports to maintain consistency and improve readability.
@IllianiCBT IllianiCBT merged commit 50fdd64 into MegaMek:master Oct 2, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AtB Bug Personnel Personnel-related Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants