Skip to content

Commit

Permalink
ensure minimum objective count for small units
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAragua committed May 26, 2021
1 parent f56d2de commit e84bd9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static void initializeCampaignState(AtBContract contract, Campaign campai
for (ObjectiveParameters objectiveParams : contractDefinition.getObjectiveParameters()) {
int objectiveCount = objectiveParams.objectiveCount > 0 ?
(int) objectiveParams.objectiveCount :
(int) (-objectiveParams.objectiveCount * contract.getRequiredLances());
(int) Math.max(1, -objectiveParams.objectiveCount * contract.getRequiredLances());

List<Integer> trackObjects = trackObjectDistribution(objectiveCount, campaignState.getTracks().size());

Expand Down
4 changes: 2 additions & 2 deletions MekHQ/src/mekhq/gui/StratconTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ private String buildShortStrategicObjectiveText(StratconCampaignState campaignSt
}

// special logic for non-independent command clauses
if (campaignState.getContract().getCommandRights() <= Contract.COM_LIAISON) {
if (!campaignState.getContract().getCommandRights().isIndependent()) {
desiredObjectives++;

if (campaignState.getVictoryPoints() > 0) {
Expand Down Expand Up @@ -345,7 +345,7 @@ private String buildStrategicObjectiveText(StratconCampaignState campaignState)
}

// special case text reminding player to complete required scenarios
if (campaignState.getContract().getCommandRights() <= Contract.COM_LIAISON) {
if (!campaignState.getContract().getCommandRights().isIndependent()) {
if (campaignState.getVictoryPoints() > 0) {
sb.append("<span color='green'>");
} else {
Expand Down

0 comments on commit e84bd9b

Please sign in to comment.