-
Notifications
You must be signed in to change notification settings - Fork 177
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
Conversation
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.
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
There was a problem hiding this comment.
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
rolesByType
this
Variable
rolesByType
this
Variable
rolesByType
There was a problem hiding this comment.
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 ReportAll modified and coverable lines are covered by tests ✅
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. |
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.
@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.
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.