diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index 60fda75c00..1c3997ca2d 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -483,7 +483,7 @@ class CivilizationInfo : IsPartOfGameInfoSerialization { // exception will happen), also rearrange existing units so that // 'nextPotentiallyDueAt' becomes 0. This way new units are always last to be due // (can be changed as wanted, just have a predictable place). - var newList = getCivUnitsStartingAtNextDue().toMutableList() + val newList = getCivUnitsStartingAtNextDue().toMutableList() newList.add(mapUnit) units = newList nextPotentiallyDueAt = 0 @@ -492,19 +492,21 @@ class CivilizationInfo : IsPartOfGameInfoSerialization { // Not relevant when updating TileInfo transients, since some info of the civ itself isn't yet available, // and in any case it'll be updated once civ info transients are updateStatsForNextTurn() // unit upkeep - updateDetailedCivResources() + if (mapUnit.baseUnit.getResourceRequirements().isNotEmpty()) + updateDetailedCivResources() } } fun removeUnit(mapUnit: MapUnit) { // See comment in addUnit(). - var newList = getCivUnitsStartingAtNextDue().toMutableList() + val newList = getCivUnitsStartingAtNextDue().toMutableList() newList.remove(mapUnit) units = newList nextPotentiallyDueAt = 0 updateStatsForNextTurn() // unit upkeep - updateDetailedCivResources() + if (mapUnit.baseUnit.getResourceRequirements().isNotEmpty()) + updateDetailedCivResources() } fun getIdleUnits() = getCivUnits().filter { it.isIdle() } diff --git a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt index 5aeba811a3..b9abd6182c 100644 --- a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt +++ b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt @@ -580,7 +580,9 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization { else civInfo.addNotification("[${offer.name}] to [$otherCivName] has ended", otherCivName, NotificationIcon.Trade) civInfo.updateStatsForNextTurn() // if they were bringing us gold per turn - civInfo.updateDetailedCivResources() // if they were giving us resources + if (trade.theirOffers.union(trade.ourOffers) // if resources were involved + .any { it.type == TradeType.Luxury_Resource || it.type == TradeType.Strategic_Resource }) + civInfo.updateDetailedCivResources() } } }