Skip to content

Commit

Permalink
Fix excessive influence when liberating a city-state (#11388)
Browse files Browse the repository at this point in the history
  • Loading branch information
axatin authored Dec 7, 2024
1 parent cdcb69a commit 3b42d67
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CvGameCoreDLL_Expansion2/CvMinorCivAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13331,21 +13331,22 @@ void CvMinorCivAI::DoLiberationByMajor(PlayerTypes eLiberator, TeamTypes eConque
}

// Influence for liberator
int iNewInfluence = max(iHighestOtherMajorInfluence + /*105*/ GD_INT_GET(MINOR_LIBERATION_FRIENDSHIP), GetBaseFriendshipWithMajor(eLiberator) + /*105*/ GD_INT_GET(MINOR_LIBERATION_FRIENDSHIP));

int iInfluenceForLiberator = /*105*/ GD_INT_GET(MINOR_LIBERATION_FRIENDSHIP);
if (MOD_BALANCE_VP)
{
int iEra = GET_PLAYER(eLiberator).GetCurrentEra();
if (iEra <= 0)
iEra = 1;

iNewInfluence *= iEra;
iInfluenceForLiberator *= iEra;

// Were we liberated from Barbarians? Less influence for you!
if (eConquerorTeam == BARBARIAN_TEAM)
iNewInfluence /= 2;
iInfluenceForLiberator /= 2;
}

int iNewInfluence = max(iHighestOtherMajorInfluence + iInfluenceForLiberator, GetBaseFriendshipWithMajor(eLiberator) + iInfluenceForLiberator);

iNewInfluence = max(GetAlliesThreshold(eLiberator) + 10, iNewInfluence); // Must be at least enough to make us allies

SetFriendshipWithMajor(eLiberator, iNewInfluence);
Expand Down

0 comments on commit 3b42d67

Please sign in to comment.