mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 20:31:51 -04:00
Fix: Freshly improved resources often do not show up on world screen, overview or trade (#2182)
Issue visible right at start of turn, saving and reloading viable workaround.
This commit is contained in:
parent
e8f63ef996
commit
076821a181
@ -371,6 +371,7 @@ class MapUnit {
|
||||
&& tileImprovement.terrainsCanBeBuiltOn.contains(tile.terrainFeature)
|
||||
&& !tileImprovement.terrainsCanBeBuiltOn.contains(tile.baseTerrain)) {
|
||||
tile.improvement = null // We removed a terrain (e.g. Forest) and the improvement (e.g. Lumber mill) requires it!
|
||||
if (tile.resource!=null) civInfo.updateDetailedCivResources() // unlikely, but maybe a mod makes a resource improvement dependent on a terrain feature
|
||||
}
|
||||
if(tile.improvementInProgress=="Remove Road" || tile.improvementInProgress=="Remove Railroad")
|
||||
tile.roadStatus = RoadStatus.None
|
||||
@ -378,7 +379,10 @@ class MapUnit {
|
||||
}
|
||||
tile.improvementInProgress == "Road" -> tile.roadStatus = RoadStatus.Road
|
||||
tile.improvementInProgress == "Railroad" -> tile.roadStatus = RoadStatus.Railroad
|
||||
else -> tile.improvement = tile.improvementInProgress
|
||||
else -> {
|
||||
tile.improvement = tile.improvementInProgress
|
||||
if (tile.resource!=null) civInfo.updateDetailedCivResources()
|
||||
}
|
||||
}
|
||||
tile.improvementInProgress = null
|
||||
}
|
||||
|
@ -176,6 +176,7 @@ object UnitActions {
|
||||
tile.turnsToImprovement = 2
|
||||
}
|
||||
tile.improvement = null
|
||||
if (tile.resource!=null) tile.getOwner()?.updateDetailedCivResources() // this might take away a resource
|
||||
if (!unit.hasUnique("No movement cost to pillage")) unit.useMovementPoints(1f)
|
||||
unit.healBy(25)
|
||||
}.takeIf { unit.currentMovement > 0 && canPillage(unit, tile) })
|
||||
|
Loading…
x
Reference in New Issue
Block a user