diff --git a/MekHQ/src/mekhq/AtBGameThread.java b/MekHQ/src/mekhq/AtBGameThread.java index 4168ecfc3b..71b9925300 100644 --- a/MekHQ/src/mekhq/AtBGameThread.java +++ b/MekHQ/src/mekhq/AtBGameThread.java @@ -410,6 +410,8 @@ public void run() { loadTransports(botClient, scenario, bf); } + boolean alreadyResetTransport = false; + // All player and bot units have been added to the lobby // Prompt the player to autoload units into transport ships if (!potentialTransports.get(SHIP_TRANSPORT.getTransportAssignmentType()).isEmpty()) { @@ -474,6 +476,7 @@ public void run() { // And now load the units. Unit crews load as passengers here. Utilities.loadPlayerTransports(transportShip.getEntity().getId(), toLoad, client, loadDropShips, loadSmallCraft, loadFighters, loadGround); + alreadyResetTransport = true; } } } @@ -516,7 +519,8 @@ public void run() { client.sendUpdateEntity(transport.getEntity()); // And now load the units. Utilities.loadPlayerTransports(transport.getEntity().getId(), toLoad, - client, loadTactical); + client, loadTactical, alreadyResetTransport); + alreadyResetTransport = true; } } } diff --git a/MekHQ/src/mekhq/Utilities.java b/MekHQ/src/mekhq/Utilities.java index c59b30c50c..14f68ab08c 100644 --- a/MekHQ/src/mekhq/Utilities.java +++ b/MekHQ/src/mekhq/Utilities.java @@ -1289,11 +1289,14 @@ public static void loadPlayerTransports(int trnId, Set toLoad, Client c * @param toLoad - Map of entity ids and transport assignments for the units we want to load * @param client - the player's Client instance * @param loadTactical - Should "tactical"-ly transported units be loaded? + * @param isAlreadyReset - transports loaded via "Ship" will have been reset once, don't do it again here * @see mekhq.campaign.enums.CampaignTransportType#TACTICAL_TRANSPORT * @see ITransportAssignment */ public static void loadPlayerTransports(int trnId, Map toLoad, Client client, - boolean loadTactical) { + boolean loadTactical, boolean isAlreadyReset) { + Set alreadyTransportedEntities = new HashSet<>(); + if (!loadTactical) { // Nothing to do. Get outta here! return; @@ -1302,7 +1305,14 @@ public static void loadPlayerTransports(int trnId, Map