Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursiveVision committed Dec 16, 2024
1 parent d7d4827 commit ca65e5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 1 addition & 5 deletions CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48131,12 +48131,8 @@ int CvDiplomacyAI::GetVassalTaxScore(PlayerTypes ePlayer)

int iOpinionWeight = 0;

int iGoldCollectedSinceVassalStarted = GetVassalGoldPerTurnCollectedSinceVassalStarted(ePlayer);
if (iGoldCollectedSinceVassalStarted == 0)
return 0;

int iGoldTaxedSinceVassalStarted = GetVassalGoldPerTurnTaxedSinceVassalStarted(ePlayer);
int iPercentTaxed = iGoldTaxedSinceVassalStarted * 100 / iGoldCollectedSinceVassalStarted;
int iPercentTaxed = iGoldTaxedSinceVassalStarted * 100 / max(iGoldCollectedSinceVassalStarted, 1);

// Opinion weight from how much % we've taxed them
iOpinionWeight = ((int) pow((float)iPercentTaxed, /*1.5f*/ GD_FLOAT_GET(OPINION_WEIGHT_VASSAL_TAX_EXPONENT))) / max(/*4*/ GD_INT_GET(OPINION_WEIGHT_VASSAL_TAX_DIVISOR), 1);
Expand Down
7 changes: 5 additions & 2 deletions CvGameCoreDLL_Expansion2/CvVotingClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10763,10 +10763,13 @@ CvLeagueAI::AlignmentLevels CvLeagueAI::EvaluateAlignment(PlayerTypes ePlayer, b
iReligionMod *= 2;
}

// Don't care at all if we're a vassal, this is covered in CvDiplomacyAI::GetVassalTreatedScore().
// Don't care at all under most circumstances if we're a vassal, this is covered in CvDiplomacyAI::GetVassalTreatedScore().
// There is one circumstance where we should still care: if the master has adopted our religion - then they get the bonus.
if (bWeAreVassal)
{
iReligionMod = 0;
ReligionTypes eOwnedReligion = GetPlayer()->GetReligions()->GetOwnedReligion();
if (eOwnedReligion == NO_RELIGION || eOwnedReligion != eTheirReligion)
iReligionMod = 0;
}

iAlignment += iReligionMod;
Expand Down

0 comments on commit ca65e5e

Please sign in to comment.