From c2a43ffee0ea9fe5220252df953202dc85cbc4fc Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Mon, 5 Jul 2021 15:34:15 +0200 Subject: [PATCH] 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 --- .../com/unciv/logic/civilization/CivInfoStats.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/core/src/com/unciv/logic/civilization/CivInfoStats.kt b/core/src/com/unciv/logic/civilization/CivInfoStats.kt index 1231f3d014..b4bb21a06d 100644 --- a/core/src/com/unciv/logic/civilization/CivInfoStats.kt +++ b/core/src/com/unciv/logic/civilization/CivInfoStats.kt @@ -105,15 +105,14 @@ class CivInfoStats(val civInfo: CivilizationInfo) { if (otherCiv.isCityState()) 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()) { - statMap.add( - "City-States", - Stats().add( - Stat.valueOf(unique.params[1]), - otherCiv.statsForNextTurn.get(Stat.valueOf(unique.params[1])) * unique.params[2].toFloat() / 100f - ) + if (otherCiv.getDiplomacyManager(civInfo.civName).relationshipLevel() != RelationshipLevel.Ally) continue + statMap.add( + "City-States", + Stats().add( + Stat.valueOf(unique.params[0]), + otherCiv.statsForNextTurn.get(Stat.valueOf(unique.params[0])) * unique.params[1].toFloat() / 100f ) - } + ) } // Deprecated since 3.15.1 if (otherCiv.isCityState() && otherCiv.getDiplomacyManager(civInfo.civName).relationshipLevel() >= RelationshipLevel.Ally) {