diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 7f145eb9e4..d8e892eefb 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -417,7 +417,8 @@ class GameInfo { for (civInfo in civilizations) { for (unit in civInfo.getCivUnits()) - unit.updateVisibleTiles() // this needs to be done after all the units are assigned to their civs and all other transients are set + unit.updateVisibleTiles(false) // this needs to be done after all the units are assigned to their civs and all other transients are set + civInfo.updateViewableTiles() // only run ONCE and not for each unit - this is a huge performance saver! // Since this depends on the cities of ALL civilizations, // we need to wait until we've set the transients of all the cities before we can run this. diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index 52ca50fd34..6d5baee5c8 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -500,7 +500,6 @@ class CityStats(val cityInfo: CityInfo) { statPercentBonusTree = newStatsBonusTree } - /** Does not update tile stats - instead, updating tile stats updates this */ fun update(currentConstruction: IConstruction = cityInfo.cityConstructions.getCurrentConstruction(), updateTileStats:Boolean = true) { if (updateTileStats) updateTileStats() diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 191bcde9e9..1ee03e1929 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -402,7 +402,7 @@ class MapUnit { /** * Update this unit's cache of viewable tiles and its civ's as well. */ - fun updateVisibleTiles() { + fun updateVisibleTiles(updateCivViewableTiles:Boolean = true) { if (baseUnit.isAirUnit()) { viewableTiles = if (hasUnique(UniqueType.SixTilesAlwaysVisible)) getTile().getTilesInDistance(6).toList() // it's that simple @@ -411,7 +411,7 @@ class MapUnit { return } viewableTiles = getTile().getViewableTilesList(getVisibilityRange()) - civInfo.updateViewableTiles() // for the civ + if (updateCivViewableTiles) civInfo.updateViewableTiles() // for the civ } fun isActionUntilHealed() = action?.endsWith("until healed") == true diff --git a/docs/uniques.md b/docs/uniques.md index 9009b31ee3..ce3e53b13f 100644 --- a/docs/uniques.md +++ b/docs/uniques.md @@ -1377,7 +1377,6 @@ Applicable to: Conditional - "-[amount]% Culture cost of acquiring tiles [cityFilter]" - Deprecated As of 3.19.1, replace with "[-amount]% Culture cost of natural border growth [cityFilter]" - "[amount]% cost of natural border growth" - Deprecated As of 3.19.1, replace with "[amount]% Culture cost of natural border growth [cityFilter]" - "-[amount]% Gold cost of acquiring tiles [cityFilter]" - Deprecated As of 3.19.1, replace with "[-amount]% Gold cost of acquiring tiles [cityFilter]" - - "May buy [baseUnitFilter] units for [amount] [stat] [cityFilter] starting from the [era] at an increasing price ([amount])" - Deprecated As of 3.17.9, replace with "May buy [baseUnitFilter] units for [amount] [stat] [cityFilter] at an increasing price ([amount]) " - "Maintenance on roads & railroads reduced by [amount]%" - Deprecated As of 3.18.17, replace with "[-amount]% maintenance on road & railroads" - "-[amount]% maintenance cost for buildings [cityFilter]" - Deprecated As of 3.18.17, replace with "[-amount]% maintenace cost for buildings [cityFilter]" - "+[amount] happiness from each type of luxury resource" - Deprecated As of 3.18.17, replace with "[+amount] Happiness from each type of luxury resource" @@ -1394,6 +1393,7 @@ Applicable to: Conditional - "Melee units pay no movement cost to pillage" - Deprecated As of 3.18.17, replace with "No movement cost to pillage " - "[mapUnitFilter] units gain [amount]% more Experience from combat" - Deprecated As of 3.18.12, replace with "[amount]% XP gained from combat " - "[amount]% maintenance costs for [mapUnitFilter] units" - Deprecated As of 3.18.14, replace with "[amount]% maintenance costs " + - "May buy [baseUnitFilter] units for [amount] [stat] [cityFilter] starting from the [era] at an increasing price ([amount])" - Deprecated As of 3.17.9, removed as of 3.19.3, replace with "May buy [baseUnitFilter] units for [amount] [stat] [cityFilter] at an increasing price ([amount]) " - "Provides a free [buildingName] [cityFilter]" - Deprecated As of 3.17.7 - removed 3.18.19, replace with "Gain a free [buildingName] [cityFilter]" - "+[amount]% [stat] [cityFilter]" - Deprecated As of 3.17.10 - removed 3.18.18, replace with "[+amount]% [stat] [cityFilter]" - "+[amount]% [stat] in all cities" - Deprecated As of 3.17.10 - removed 3.18.18, replace with "[+amount]% [stat] [in all cities]"