Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Theatre of War Faction Checks #5307

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion MekHQ/src/mekhq/gui/dialog/AutoAwardsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private void initComponents() {
AutoAwardsTableModel model = new AutoAwardsTableModel(campaign);
// This is where we insert the external data
logger.info("Trying to pass data to AutoAwardsTableModel.java");
logger.info("Data being passed: {}", data);
logger.debug("Data being passed: {}", data);
model.setData(data);
logger.info("Attempt successful");
personnelTable = new AutoAwardsTable(model);
Expand Down
4 changes: 2 additions & 2 deletions MekHQ/src/mekhq/gui/model/AutoAwardsTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public void setData(Map<Integer, List<Object>> map) {
if (map.isEmpty()) {
logger.error("AutoAwardsDialog failed to pass 'data' into AutoAwardsTableModel");
} else {
logger.info("AutoAwardsDialog passed 'data' into AutoAwardsTableModel: {}", map);
logger.debug("AutoAwardsDialog passed 'data' into AutoAwardsTableModel: {}", map);
}

data = map;
logger.info("Translated data: {}", data);
logger.debug("Translated data: {}", data);
}

@Override
Expand Down
Loading