Skip to content

Commit

Permalink
Merge pull request #4539 from IllianiCBT/autoAwards_formationReading
Browse files Browse the repository at this point in the history
Refactored autoAwards Kill Handling for Improved Reliability
IllianiCBT authored Aug 8, 2024
2 parents 8767e68 + 07c54c7 commit 0e12f4a
Showing 3 changed files with 258 additions and 350 deletions.
7 changes: 1 addition & 6 deletions MekHQ/src/mekhq/campaign/force/Force.java
Original file line number Diff line number Diff line change
@@ -750,7 +750,6 @@ public int getPrimaryUnitType(Campaign c) {
* Finds the distance (depth) from the origin force
* @param force the force to get depth for
*/
@SuppressWarnings(value = "unused")
public static int getDepth(Force force) {
int depth = 0;

@@ -805,11 +804,9 @@ public static void populateFormationLevelsFromOrigin(Campaign campaign) {

// we then set lower boundaries (i.e., how far we can decrease formation level)
int lowerBoundary = getLowerBoundary(campaign);
int currentFormationLevel;
int currentFormationLevel = force.getFormationLevel().parseToInt();

for (Force subforce : force.getSubForces()) {
currentFormationLevel = force.getFormationLevel().parseToInt();

if (currentFormationLevel - 1 < lowerBoundary) {
subforce.setFormationLevel(FormationLevel.INVALID);
continue;
@@ -838,8 +835,6 @@ private static void changeFormationLevel(Force force, int currentFormationLevel,
}

subforce.setFormationLevel(FormationLevel.parseFromInt(currentFormationLevel - 1));

changeFormationLevel(subforce, currentFormationLevel - 1, lowerBoundary);
}
}

Loading

0 comments on commit 0e12f4a

Please sign in to comment.