Update civ resources when selling a building and destroying a unit

This commit is contained in:
Yair Morgenstern 2019-06-20 23:08:30 +03:00
parent e0f72af06d
commit 6d3ef94941
2 changed files with 4 additions and 0 deletions

View File

@ -303,6 +303,9 @@ class CityInfo {
cityConstructions.removeBuilding(buildingName)
civInfo.gold += getGoldForSellingBuilding(buildingName)
hasSoldBuildingThisTurn=true
cityStats.update()
civInfo.updateDetailedCivResources() // this building could be a resource-requiring one
}

View File

@ -316,6 +316,7 @@ class CivilizationInfo {
newList.remove(mapUnit)
units=newList
updateStatsForNextTurn() // unit upkeep
updateDetailedCivResources()
}
fun getIdleUnits() = getCivUnits().filter { it.isIdle() }