Skip to content

Commit

Permalink
Stopped Scenarios Pulling Units from the Hangar
Browse files Browse the repository at this point in the history
Certain scenarios are set up to substitute enemy units with player units. Typically, this is the DropShip scenarios optionally using player DropShips. Previously, this could pull units from the players' hangar. Now it is restricted to units in the TO&E.
  • Loading branch information
IllianiCBT committed Oct 27, 2024
1 parent f0099f1 commit d153a19
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions MekHQ/src/mekhq/campaign/stratcon/StratconRulesManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,11 @@ private static void swapInPlayerUnits(StratconScenario scenario, Campaign campai

// find units in player's campaign (not just forces!)
// by default, all units 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
} else {
Force force = campaign.getForce(explicitForceID);
for (UUID unitID : force.getUnits()) {
Unit unit = campaign.getUnit(unitID);
if (unit.getTransportShipAssignment() != null) {
potentialUnits.add(unit.getTransportShipAssignment().getTransportShip());
}
Force force = campaign.getForce(explicitForceID);
for (UUID unitID : force.getUnits()) {
Unit unit = campaign.getUnit(unitID);
if (unit.getTransportShipAssignment() != null) {
potentialUnits.add(unit.getTransportShipAssignment().getTransportShip());
}
}

Expand Down

0 comments on commit d153a19

Please sign in to comment.