Skip to content

Commit

Permalink
Merge pull request #5136 from IllianiCBT/education_reeducationCampsWa…
Browse files Browse the repository at this point in the history
…rtime

Fixed Faction Conflict Checks for Reeducation Camps
HammerGS authored Oct 29, 2024
2 parents f0099f1 + 8c6e454 commit 7200776
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
@@ -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();
}
}
}

@@ -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())) {

0 comments on commit 7200776

Please sign in to comment.