Skip to content

Commit

Permalink
Change where we check if force is combat flagged
Browse files Browse the repository at this point in the history
With some help and use of debugger, we found the bit where it steps through each force to check the flag.

I've tested this with the debugger and it looks to work in a test campaign but needs solid testing.
  • Loading branch information
UlyssesSockdrawer committed Oct 8, 2024
1 parent 1c781ae commit 4e72790
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions MekHQ/src/mekhq/campaign/stratcon/StratconRulesManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@ public static List<Integer> getAvailableForceIDs(Campaign campaign) {
.mapToInt(key -> key)
.mapToObj(campaign::getForce).filter(force -> (force != null)
&& !force.isDeployed()
&& force.isCombatForce()
&& !forcesInTracks.contains(force.getId()))
.map(Force::getId)
.collect(Collectors.toList());
Expand Down Expand Up @@ -1125,16 +1126,6 @@ public static List<Integer> getAvailableForceIDs(int unitType, Campaign campaign
continue;
}

//checks if force is flagged as combat in TOE
if (!force.isCombatForce()) {
continue;
}

//checks if force is not top level (suggested by Illiani)
if (force.getFormationLevel().getDepth() != 0) {
continue;
}

int primaryUnitType = force.getPrimaryUnitType(campaign);
boolean noReinforcementRestriction = !reinforcements || (reinforcements
&& (getReinforcementType(force.getId(), currentTrack, campaign,
Expand Down

0 comments on commit 4e72790

Please sign in to comment.