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

Stopped Scenarios Pulling Units from the Hangar #5137

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions MekHQ/src/mekhq/campaign/stratcon/StratconRulesManager.java
Original file line number Diff line number Diff line change
@@ -288,12 +288,17 @@ private static void swapInPlayerUnits(StratconScenario scenario, Campaign campai

Collection<Unit> potentialUnits = new HashSet<>();

// find units in player's campaign (not just forces!)
// by default, all units are eligible
// find units in player's campaign by default, all units in the TO&E are eligible
if (explicitForceID == Force.FORCE_NONE) {
potentialUnits = campaign.getHangar().getUnits();
// if we're using a seed force, then units transporting this force
// are eligible
for (UUID unitId : campaign.getForces().getUnits()) {
try {
potentialUnits.add(campaign.getUnit(unitId));
} catch (Exception exception) {
logger.error(String.format("Error retrieving unit (%s): %s",
unitId, exception.getMessage()));
}
}
// if we're using a seed force, then units transporting this force are eligible
} else {
Force force = campaign.getForce(explicitForceID);
for (UUID unitID : force.getUnits()) {
@@ -303,7 +308,6 @@ private static void swapInPlayerUnits(StratconScenario scenario, Campaign campai
}
}
}

for (Unit unit : potentialUnits) {
if ((sft.getAllowedUnitType() == 11) && (!campaign.getCampaignOptions().isUseDropShips())) {
continue;