Skip to content

Commit

Permalink
Merge pull request #5786 from IllianiCBT/stratCon_objectiveReset
Browse files Browse the repository at this point in the history
Corrected Objective Calculations when Assigning Forces to StratCon Scenarios
  • Loading branch information
HammerGS authored Jan 15, 2025
2 parents ae958c7 + 7dcf890 commit e6715a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions MekHQ/src/mekhq/gui/stratcon/StratconScenarioWizard.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import mekhq.campaign.stratcon.StratconCampaignState;
import mekhq.campaign.stratcon.StratconRulesManager;
import mekhq.campaign.stratcon.StratconScenario;
import mekhq.campaign.stratcon.StratconScenario.ScenarioState;
import mekhq.campaign.stratcon.StratconTrackState;
import mekhq.campaign.unit.Unit;
import mekhq.gui.utilities.JScrollPaneWithSpeed;
Expand All @@ -51,9 +50,8 @@
import static mekhq.campaign.stratcon.StratconRulesManager.*;
import static mekhq.campaign.stratcon.StratconRulesManager.ReinforcementResultsType.DELAYED;
import static mekhq.campaign.stratcon.StratconRulesManager.ReinforcementResultsType.FAILED;
import static mekhq.campaign.stratcon.StratconRulesManager.calculateReinforcementTargetNumber;
import static mekhq.campaign.stratcon.StratconRulesManager.getEligibleLeadershipUnits;
import static mekhq.campaign.stratcon.StratconRulesManager.processReinforcementDeployment;
import static mekhq.campaign.stratcon.StratconScenario.ScenarioState.PRIMARY_FORCES_COMMITTED;
import static mekhq.campaign.stratcon.StratconScenario.ScenarioState.REINFORCEMENTS_COMMITTED;
import static mekhq.gui.baseComponents.MHQDialogImmersive.getSpeakerDescription;
import static mekhq.gui.dialog.resupplyAndCaches.ResupplyDialogUtilities.getSpeakerIcon;
import static mekhq.utilities.ImageUtilities.scaleImageIconToWidth;
Expand Down Expand Up @@ -851,7 +849,7 @@ private void btnCommitClicked(ActionEvent evt, @Nullable Integer reinforcementTa
// go through all the force lists and add the selected forces to the scenario
for (String templateID : availableForceLists.keySet()) {
for (Force force : availableForceLists.get(templateID).getSelectedValuesList()) {
if (currentScenario.getCurrentState() == ScenarioState.PRIMARY_FORCES_COMMITTED) {
if (currentScenario.getCurrentState() == PRIMARY_FORCES_COMMITTED) {
ReinforcementEligibilityType reinforcementType = getReinforcementType(
force.getId(), currentTrackState, campaign, currentCampaignState);

Expand Down Expand Up @@ -904,8 +902,10 @@ private void btnCommitClicked(ActionEvent evt, @Nullable Integer reinforcementTa

currentScenario.updateMinefieldCount(Minefield.TYPE_CONVENTIONAL, getNumMinefields());

translateTemplateObjectives(currentScenario.getBackingScenario(), campaign);
scaleObjectiveTimeLimits(currentScenario.getBackingScenario(), campaign);
if (currentScenario.getCurrentState().ordinal() < REINFORCEMENTS_COMMITTED.ordinal()) {
translateTemplateObjectives(currentScenario.getBackingScenario(), campaign);
scaleObjectiveTimeLimits(currentScenario.getBackingScenario(), campaign);
}

this.getParent().repaint();

Expand Down

0 comments on commit e6715a5

Please sign in to comment.