From 73f666920b6910a46393aa21d2dba12aa0b06271 Mon Sep 17 00:00:00 2001 From: IllianiCBT Date: Mon, 14 Oct 2024 12:08:38 -0500 Subject: [PATCH] Add check for StratCon in getAtBBattleChance Updated the getAtBBattleChance method to return 0 if StratCon is enabled. This ensures that no battle chances are calculated when StratCon is in use. --- MekHQ/src/mekhq/campaign/CampaignOptions.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MekHQ/src/mekhq/campaign/CampaignOptions.java b/MekHQ/src/mekhq/campaign/CampaignOptions.java index 3f5360364f..a8f2769c36 100644 --- a/MekHQ/src/mekhq/campaign/CampaignOptions.java +++ b/MekHQ/src/mekhq/campaign/CampaignOptions.java @@ -4465,9 +4465,13 @@ public void setPlayerControlsAttachedUnits(final boolean playerControlsAttachedU /** * @param role the {@link AtBLanceRole} to get the battle chance for - * @return the chance of having a battle for the specified role + * @return the chance of having a battle for the specified role, or {@code 0} if StratCon is enabled */ public int getAtBBattleChance(final AtBLanceRole role) { + if (useStratCon) { + return 0; + } + return role.isUnassigned() ? 0 : atbBattleChance[role.ordinal()]; }