Skip to content

Commit

Permalink
Fixed Faction Conflict Checks for Reeducation Camps
Browse files Browse the repository at this point in the history
Adjusted logic to ensure reeducation camps only consider wars involving the campaign faction. This means players can continue brainwashing their prisoners without fear of a pesky little thing like 'interstellar war' getting in the way.
  • Loading branch information
IllianiCBT committed Oct 27, 2024
1 parent f0099f1 commit 8c6e454
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions MekHQ/src/mekhq/campaign/personnel/education/Academy.java
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,16 @@ public String getFilteredFaction(Campaign campaign, Person person, List<String>
return null;
}

if (!hints.isAtWarWith(originFaction, faction, campaign.getLocalDate())
// For reeducation camps we only care about whether the campaign faction is at war
if (isReeducationCamp) {
if (!hints.isAtWarWith(campaignFaction, faction, campaign.getLocalDate())) {
return faction.getShortName();
}
} else {
if (!hints.isAtWarWith(originFaction, faction, campaign.getLocalDate())
|| !hints.isAtWarWith(campaignFaction, faction, campaign.getLocalDate())) {
return faction.getShortName();
return faction.getShortName();
}
}
}

Expand Down Expand Up @@ -697,6 +704,12 @@ public int getEducationLevel(Person person) {
* @return true if there is a faction conflict, false otherwise.
*/
public Boolean isFactionConflict(Campaign campaign, Person person) {
// Reeducation camps only care if they're at war with the campaign faction
if (isReeducationCamp) {
return RandomFactionGenerator.getInstance().getFactionHints().isAtWarWith(campaign.getFaction(),
Factions.getInstance().getFaction(person.getEduAcademyFaction()), campaign.getLocalDate());
}

// is there a conflict between academy faction & person's faction?
if (RandomFactionGenerator.getInstance().getFactionHints().isAtWarWith(person.getOriginFaction(),
Factions.getInstance().getFaction(person.getEduAcademyFaction()), campaign.getLocalDate())) {
Expand Down

0 comments on commit 8c6e454

Please sign in to comment.