Skip to content

Commit

Permalink
Fix incorrect parameter order in processFaction call
Browse files Browse the repository at this point in the history
Reordered parameters in the processFaction method call to ensure proper functionality. Removed unnecessary instanceof check for AtBContract when verifying campaign options usage. These changes improve code accuracy and reliability in processing faction details.
  • Loading branch information
IllianiCBT committed Dec 5, 2024
1 parent fd73dc9 commit be8f60f
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ public static Map<Integer, List<Object>> TheatreOfWarAwardsProcessor(Campaign ca
boolean isEligible;
List<Award> eligibleAwards = new ArrayList<>();

String employer = ((Contract) mission).getEmployer();
// if the mission isn't an instance of 'AtBContract' we won't have the information we need,
// so abort processing.
if (!(mission instanceof AtBContract)) {
return AutoAwardsController.prepareAwardData(person, eligibleAwards);
}

String employer = ((AtBContract) mission).getEmployerCode();

int contractStartYear = ((Contract) mission).getStartDate().getYear();
int currentYear = campaign.getGameYear();
Expand Down Expand Up @@ -103,10 +109,10 @@ public static Map<Integer, List<Object>> TheatreOfWarAwardsProcessor(Campaign ca
}

if (belligerents.size() == 1) {
if (!processFaction(belligerents.get(0), employer)) {
if (!processFaction(employer, belligerents.get(0))) {
continue;
}
} else if ((campaign.getCampaignOptions().isUseAtB()) && (mission instanceof AtBContract)) {
} else if (campaign.getCampaignOptions().isUseAtB()) {
String enemy = ((AtBContract) mission).getEnemyCode();

if (hasLoyalty(employer, attackers)) {
Expand Down

0 comments on commit be8f60f

Please sign in to comment.