From 101fa9903e83bbb6a32bafc3dd263fe5c8eef6f5 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 23 Nov 2020 19:20:23 +0200 Subject: [PATCH] Fixed unit icons not getting deleted when unit exits tile --- core/src/com/unciv/ui/tilegroups/TileGroupIcons.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/com/unciv/ui/tilegroups/TileGroupIcons.kt b/core/src/com/unciv/ui/tilegroups/TileGroupIcons.kt index 40a314b3cc..6fc6e02002 100644 --- a/core/src/com/unciv/ui/tilegroups/TileGroupIcons.kt +++ b/core/src/com/unciv/ui/tilegroups/TileGroupIcons.kt @@ -53,6 +53,7 @@ class TileGroupIcons(val tileGroup: TileGroup){ fun newUnitIcon(unit: MapUnit?, oldUnitGroup: UnitGroup?, isViewable: Boolean, yFromCenter: Float, viewingCiv: CivilizationInfo?): UnitGroup? { var newImage: UnitGroup? = null // The unit can change within one update - for instance, when attacking, the attacker replaces the defender! + oldUnitGroup?.unitBaseImage?.remove() oldUnitGroup?.remove() if (unit != null && isViewable) { // Tile is visible