Skip to content

Commit

Permalink
Merge pull request #4819 from IllianiCBT/turnover_hiddenLoyalty
Browse files Browse the repository at this point in the history
Fixed Hidden Loyalty Calculation in RetirementDefectionTracker
  • Loading branch information
IllianiCBT authored Sep 13, 2024
2 parents a9f6cf5 + 7c13992 commit 831b222
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,16 @@ public static int getCombinedSkillValues(Campaign campaign, String skillType) {
* @return the base target number
*/
private int getBaseTargetNumber(Campaign campaign, Person person) {
if ((campaign.getCampaignOptions().isUseLoyaltyModifiers())
&& (campaign.getCampaignOptions().isUseHideLoyalty())) {
return campaign.getCampaignOptions().getTurnoverFixedTargetNumber() + person.getLoyalty();
if ((campaign.getCampaignOptions().isUseLoyaltyModifiers()) && (campaign.getCampaignOptions().isUseHideLoyalty())) {
int loyaltyScore = person.getLoyalty();

if (person.isCommander()) {
loyaltyScore += 2;
}

int loyaltyModifier = person.getLoyaltyModifier(loyaltyScore);

return campaign.getCampaignOptions().getTurnoverFixedTargetNumber() + loyaltyModifier;
} else {
return campaign.getCampaignOptions().getTurnoverFixedTargetNumber();
}
Expand Down Expand Up @@ -899,7 +906,7 @@ public void removePayout(Person person) {

/**
* Clears out an individual entirely from this tracker.
*
*
* @param person The person to remove
*/
public void removePerson(Person person) {
Expand Down

0 comments on commit 831b222

Please sign in to comment.