mirror of
https://github.com/yairm210/Unciv.git
synced 2024-12-22 22:54:44 +07:00
Resolve #12617 - Remove images of expended units
This commit is contained in:
parent
75fc42e1c8
commit
f9e7451249
@ -45,8 +45,13 @@ class TileLayerUnitSprite(tileGroup: TileGroup, size: Float) : TileLayer(tileGro
|
||||
nationName = "${unit.civ.civName}-"
|
||||
}
|
||||
|
||||
if ((currentSlot?.currentImageLocation ?: "") == "$nationName$location") return currentSlot // No-op
|
||||
if (location == "" || !ImageGetter.imageExists(location)) return null // No such image
|
||||
if (currentSlot == null && location == "") return null // No-op - had none, has none
|
||||
if (currentSlot?.currentImageLocation == "$nationName$location") return currentSlot // No-op - had, has
|
||||
|
||||
if (location == "" || !ImageGetter.imageExists(location)){
|
||||
currentSlot?.spriteGroup?.remove()
|
||||
return null
|
||||
}
|
||||
|
||||
val slot = currentSlot ?: UnitSpriteSlot()
|
||||
.apply { this@TileLayerUnitSprite.addActor(spriteGroup) }
|
||||
|
Loading…
Reference in New Issue
Block a user