Skip to content

Commit

Permalink
Fix an issue where stacking diplo mods persist
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursiveVision committed Jul 19, 2024
1 parent bb09702 commit 4d67abd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45272,11 +45272,12 @@ static void checkAndUpdateStackingOpinionModifier(
{
int iTurnDifference = iTurn - (pThis->*getTurn)(ePlayer);
int iDuration = pThis->AdjustModifierDuration(baseTurns, modifier, bInvert, true);
if (iTurnDifference >= iDuration)
{
iStacks /= 2;
(pThis->*setStacks)(ePlayer, iStacks);
}
while (iTurnDifference >= iDuration && iStacks > 0)
{
iStacks /= 2;
iTurnDifference -= iDuration;
}
(pThis->*setStacks)(ePlayer, iStacks);
}
}

Expand Down

0 comments on commit 4d67abd

Please sign in to comment.