diff --git a/MekHQ/resources/mekhq/resources/CampaignGUI.properties b/MekHQ/resources/mekhq/resources/CampaignGUI.properties
index 389f30489e..941f8120c4 100644
--- a/MekHQ/resources/mekhq/resources/CampaignGUI.properties
+++ b/MekHQ/resources/mekhq/resources/CampaignGUI.properties
@@ -49,6 +49,7 @@ miMHQOptions.text=MekHQ Options...
miMHQOptions.toolTipText=This launches the MekHQ Options Dialog.
menuThemes.text=Themes
menuExit.text=Exit
+mekSelectorDialog.unsupported.gunEmplacement=Gun Emplacements are %snot supported%s by MekHQ.
# Marketplace Menu
menuMarket.text=Marketplace
diff --git a/MekHQ/resources/mekhq/resources/GUI.properties b/MekHQ/resources/mekhq/resources/GUI.properties
index d0a91c4822..fc12362c29 100644
--- a/MekHQ/resources/mekhq/resources/GUI.properties
+++ b/MekHQ/resources/mekhq/resources/GUI.properties
@@ -593,6 +593,12 @@ DataLoadingDialog.OutOfMemoryError.text=MekHQ ran out of memory attempting to lo
DataLoadingDialog.ExecutionException.title=Campaign Loading Error
DataLoadingDialog.ExecutionException.text=The campaign file couldn't be loaded. \nPlease check the MekHQ.log file for details.
+## Unsupported Units
+unsupportedUnits.title=Unsupported Units Detected
+unsupportedUnits.body=The following units are not supported by MekHQ and have been sold.\
+
\
+
All assigned personnel have been unassigned.
+
### GMToolsDialog Class
GMToolsDialog.title=GM Tools
## General Tab
diff --git a/MekHQ/src/mekhq/campaign/ResolveScenarioTracker.java b/MekHQ/src/mekhq/campaign/ResolveScenarioTracker.java
index 40b2031f03..ec3c5bca12 100644
--- a/MekHQ/src/mekhq/campaign/ResolveScenarioTracker.java
+++ b/MekHQ/src/mekhq/campaign/ResolveScenarioTracker.java
@@ -368,6 +368,11 @@ public void processGame() {
}
}
} else if (wreck.getOwner().isEnemyOf(client.getLocalPlayer())) {
+ // MekHQ doesn't support gun emplacements, so we don't want the player salvaging them
+ if (wreck instanceof GunEmplacement) {
+ continue;
+ }
+
if (wreck.isDropShip() && scenario.getBoardType() != Scenario.T_SPACE) {
double dropShipBonusPercentage =
(double) campaign.getCampaignOptions().getDropShipBonusPercentage() / 100;
diff --git a/MekHQ/src/mekhq/gui/dialog/DataLoadingDialog.java b/MekHQ/src/mekhq/gui/dialog/DataLoadingDialog.java
index 567f5f6246..e09888bb01 100644
--- a/MekHQ/src/mekhq/gui/dialog/DataLoadingDialog.java
+++ b/MekHQ/src/mekhq/gui/dialog/DataLoadingDialog.java
@@ -21,6 +21,8 @@
import megamek.client.generator.RandomCallsignGenerator;
import megamek.client.generator.RandomNameGenerator;
import megamek.client.ui.swing.util.UIUtil;
+import megamek.common.Entity;
+import megamek.common.GunEmplacement;
import megamek.common.MekSummaryCache;
import megamek.common.annotations.Nullable;
import megamek.common.options.OptionsConstants;
@@ -44,6 +46,7 @@
import mekhq.campaign.rating.CamOpsReputation.ReputationController;
import mekhq.campaign.storyarc.StoryArc;
import mekhq.campaign.storyarc.StoryArcStub;
+import mekhq.campaign.unit.Unit;
import mekhq.campaign.universe.Factions;
import mekhq.campaign.universe.RATManager;
import mekhq.campaign.universe.Systems;
@@ -58,6 +61,8 @@
import java.io.File;
import java.io.FileInputStream;
import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.List;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
@@ -422,12 +427,60 @@ public Campaign doInBackground() throws Exception {
reputationController.initializeReputation(campaign);
campaign.setReputation(reputationController);
}
+
+ sellUnsupportedUnits(campaign);
// endregion Progress 7
}
campaign.setApp(getApplication());
return campaign;
}
+
+
+ /**
+ * Sells unsupported units.
+ *
+ * This method checks all units in the specified campaign and determines if they are unsupported. + * Currently, only gun emplacements are identified as unsupported and are sold upon campaign load. + * If unsupported units are sold, a notification is displayed to the user detailing the sold units, + * including their names and IDs. Additionally, personnel assigned to these units are + * automatically unassigned. + *
+ * + * @param retVal The campaign being checked for unsupported units. This includes the unit list + * and the quartermaster who handles the selling process. + */ + private static void sellUnsupportedUnits(Campaign retVal) { + List