#4963 - All city-state influences recalculate ally civ, which recalculates resources, which recalculates stats.

This commit is contained in:
yairm210
2021-09-15 01:47:17 +03:00
parent b7eb21b606
commit ce8dd40c60
4 changed files with 1 additions and 7 deletions

View File

@ -132,8 +132,6 @@ class CityStateFunctions(val civInfo: CivilizationInfo) {
donorCiv.addGold(-giftAmount)
civInfo.addGold(giftAmount)
civInfo.getDiplomacyManager(donorCiv).addInfluence(influenceGainedByGift(donorCiv, giftAmount).toFloat())
updateAllyCivForCityState()
donorCiv.updateStatsForNextTurn()
}
fun getProtectorCivs() : List<CivilizationInfo> {
@ -380,8 +378,6 @@ class CityStateFunctions(val civInfo: CivilizationInfo) {
civInfo.getDiplomacyManager(demandingCiv).addInfluence(-15f)
cityStateBullied(demandingCiv)
civInfo.addFlag(CivFlags.RecentlyBullied.name, 20)
updateAllyCivForCityState()
civInfo.updateStatsForNextTurn()
}
fun tributeWorker(demandingCiv: CivilizationInfo) {
@ -398,7 +394,6 @@ class CityStateFunctions(val civInfo: CivilizationInfo) {
civInfo.getDiplomacyManager(demandingCiv).addInfluence(-50f)
cityStateBullied(demandingCiv)
civInfo.addFlag(CivFlags.RecentlyBullied.name, 20)
updateAllyCivForCityState()
}
fun canGiveStat(statType: Stat): Boolean {

View File

@ -172,5 +172,6 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo) {
for ((resource, amount) in unit.baseUnit.getResourceRequirements())
newDetailedCivResources.add(civInfo.gameInfo.ruleSet.tileResources[resource]!!, -amount, "Units")
civInfo.detailedCivResources = newDetailedCivResources
civInfo.updateStatsForNextTurn() // More or less resources = more or less happiness, with potential domino effects
}
}

View File

@ -716,7 +716,6 @@ class CivilizationInfo {
goldenAges.endTurn(getHappiness())
getCivUnits().forEach { it.endTurn() } // This is the most expensive part of endTurn
diplomacy.values.toList().forEach { it.nextTurn() } // we copy the diplomacy values so if it changes in-loop we won't crash
updateAllyCivForCityState()
updateHasActiveGreatWall()
cachedMilitaryMight = -1 // Reset so we don't use a value from a previous turn

View File

@ -675,7 +675,6 @@ class DiplomacyManager() {
otherCivDiplomacy.totalOfScienceDuringRA = 0
}
otherCivDiplomacy.removeFlag(DiplomacyFlags.ResearchAgreement)
if (otherCiv.isCityState()) otherCiv.updateAllyCivForCityState()
if (!civInfo.isCityState()) {
for (thirdCiv in civInfo.getKnownCivs()) {