Skip to content

Commit 522ff5b

Browse files
authored
Merge pull request #7203 from IllianiBird/bugAdminAssignment
Fix: #7127 No Longer Unassign Primary Role if Secondary is Admin, Unassign Secondary Instead
2 parents 7108839 + 0295012 commit 522ff5b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

MekHQ/src/mekhq/campaign/personnel/Person.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3368,20 +3368,20 @@ public static Person generateInstanceFromXML(Node wn, Campaign campaign, Version
33683368

33693369
// This resolves a bug squashed in 2025 (50.03) but lurked in our codebase
33703370
// potentially as far back as 2014. The next two handlers should never be removed.
3371-
if (!person.canPerformRole(campaign.getLocalDate(), person.getPrimaryRole(), true)) {
3372-
person.setPrimaryRole(campaign, PersonnelRole.NONE);
3371+
if (!person.canPerformRole(campaign.getLocalDate(), person.getSecondaryRole(), false)) {
3372+
person.setSecondaryRole(PersonnelRole.NONE);
33733373

3374-
campaign.addReport(String.format(resources.getString("ineligibleForPrimaryRole"),
3375-
spanOpeningWithCustomColor(ReportingUtilities.getNegativeColor()),
3374+
campaign.addReport(String.format(resources.getString("ineligibleForSecondaryRole"),
3375+
spanOpeningWithCustomColor(ReportingUtilities.getWarningColor()),
33763376
CLOSING_SPAN_TAG,
33773377
person.getHyperlinkedFullTitle()));
33783378
}
33793379

3380-
if (!person.canPerformRole(campaign.getLocalDate(), person.getSecondaryRole(), false)) {
3381-
person.setSecondaryRole(PersonnelRole.NONE);
3380+
if (!person.canPerformRole(campaign.getLocalDate(), person.getPrimaryRole(), true)) {
3381+
person.setPrimaryRole(campaign, PersonnelRole.NONE);
33823382

3383-
campaign.addReport(String.format(resources.getString("ineligibleForSecondaryRole"),
3384-
spanOpeningWithCustomColor(ReportingUtilities.getWarningColor()),
3383+
campaign.addReport(String.format(resources.getString("ineligibleForPrimaryRole"),
3384+
spanOpeningWithCustomColor(ReportingUtilities.getNegativeColor()),
33853385
CLOSING_SPAN_TAG,
33863386
person.getHyperlinkedFullTitle()));
33873387
}

0 commit comments

Comments
 (0)