Skip to content

Commit a3df5e3

Browse files
committed
Resolved #10417 - "Nullifies all other stats this tile provides" includes nullifying improvement stats
1 parent d99fbd8 commit a3df5e3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: core/src/com/unciv/logic/map/tile/TileStatFunctions.kt

+6-2
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,15 @@ class TileStatFunctions(val tile: Tile) {
5656
): List<Pair<String, Stats>> {
5757
val stateForConditionals = StateForConditionals(civInfo = observingCiv, city = city, tile = tile)
5858
val listOfStats = getTerrainStatsBreakdown(stateForConditionals)
59+
60+
val otherYieldsIgnored = tile.allTerrains.any { it.hasUnique(UniqueType.NullifyYields, stateForConditionals) }
5961

60-
val improvement = tile.getUnpillagedTileImprovement()
62+
val improvement = if (otherYieldsIgnored) null // Treat it as if there is no improvement
63+
else tile.getUnpillagedTileImprovement()
6164
val improvementStats = improvement?.cloneStats() ?: Stats.ZERO // If improvement==null, will never be added to
6265

63-
val road = tile.getUnpillagedRoadImprovement()
66+
val road = if (otherYieldsIgnored) null
67+
else tile.getUnpillagedRoadImprovement()
6468
val roadStats = road?.cloneStats() ?: Stats.ZERO
6569

6670
if (city != null) {

0 commit comments

Comments
 (0)