mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 23:40:01 +07:00
Fixed unit icons not getting deleted when unit exits tile
This commit is contained in:
@ -53,6 +53,7 @@ class TileGroupIcons(val tileGroup: TileGroup){
|
|||||||
fun newUnitIcon(unit: MapUnit?, oldUnitGroup: UnitGroup?, isViewable: Boolean, yFromCenter: Float, viewingCiv: CivilizationInfo?): UnitGroup? {
|
fun newUnitIcon(unit: MapUnit?, oldUnitGroup: UnitGroup?, isViewable: Boolean, yFromCenter: Float, viewingCiv: CivilizationInfo?): UnitGroup? {
|
||||||
var newImage: UnitGroup? = null
|
var newImage: UnitGroup? = null
|
||||||
// The unit can change within one update - for instance, when attacking, the attacker replaces the defender!
|
// The unit can change within one update - for instance, when attacking, the attacker replaces the defender!
|
||||||
|
oldUnitGroup?.unitBaseImage?.remove()
|
||||||
oldUnitGroup?.remove()
|
oldUnitGroup?.remove()
|
||||||
|
|
||||||
if (unit != null && isViewable) { // Tile is visible
|
if (unit != null && isViewable) { // Tile is visible
|
||||||
|
Reference in New Issue
Block a user