Skip to content

Commit 20761c5

Browse files
authored
Merge pull request #6580 from IllianiBird/infiniteLoop
Fixed Infinite Loop in `getAvailableForceIDs` (Sentry)
2 parents 951fb18 + e99e832 commit 20761c5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

MekHQ/src/mekhq/campaign/stratcon/StratconRulesManager.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -2413,7 +2413,13 @@ public static List<Integer> getAvailableForceIDs(Campaign campaign, AtBContract
24132413
}
24142414

24152415
if (suitableForces.isEmpty()) {
2416-
suitableForces = getAvailableForceIDs(campaign, contract, true);
2416+
if (!bypassRoleRestrictions) {
2417+
logger.info("No suitable combat teams found for contract {}. Relaxing restrictions", contract.getId());
2418+
suitableForces = getAvailableForceIDs(campaign, contract, true);
2419+
} else {
2420+
logger.info("No suitable combat teams found for contract {} despite relaxed restrictions." +
2421+
" Scenario generation will likely be skipped.", contract.getId());
2422+
}
24172423
}
24182424

24192425
return suitableForces;

0 commit comments

Comments
 (0)