Fixed bug where city-states would not share their science income even if the player had the right policy (#4381)

* Fixed bug where city-states would not share their science income even if the player had the right policy

* Implemented requested changes
This commit is contained in:
Xander Lenstra 2021-07-05 15:34:15 +02:00 committed by GitHub
parent d909143a34
commit c2a43ffee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,15 +105,14 @@ class CivInfoStats(val civInfo: CivilizationInfo) {
if (otherCiv.isCityState()) if (otherCiv.isCityState())
for (unique in civInfo.getMatchingUniques("Allied City-States provide [] equal to []% of what they produce for themselves")) { for (unique in civInfo.getMatchingUniques("Allied City-States provide [] equal to []% of what they produce for themselves")) {
if (otherCiv.diplomacy[civInfo.civName]!!.matchesCityStateRelationshipFilter(unique.params[0]) && otherCiv.cities.isNotEmpty()) { if (otherCiv.getDiplomacyManager(civInfo.civName).relationshipLevel() != RelationshipLevel.Ally) continue
statMap.add( statMap.add(
"City-States", "City-States",
Stats().add( Stats().add(
Stat.valueOf(unique.params[1]), Stat.valueOf(unique.params[0]),
otherCiv.statsForNextTurn.get(Stat.valueOf(unique.params[1])) * unique.params[2].toFloat() / 100f otherCiv.statsForNextTurn.get(Stat.valueOf(unique.params[0])) * unique.params[1].toFloat() / 100f
)
) )
} )
} }
// Deprecated since 3.15.1 // Deprecated since 3.15.1
if (otherCiv.isCityState() && otherCiv.getDiplomacyManager(civInfo.civName).relationshipLevel() >= RelationshipLevel.Ally) { if (otherCiv.isCityState() && otherCiv.getDiplomacyManager(civInfo.civName).relationshipLevel() >= RelationshipLevel.Ally) {