From 11bb63495b003899d7e57c4053016c75adfca820 Mon Sep 17 00:00:00 2001 From: Duan Tao Date: Mon, 18 Mar 2019 18:40:11 +0800 Subject: [PATCH] Fixed : unit upgrades to itself with 10 gold. --- core/src/com/unciv/logic/map/MapUnit.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index b020cc1aa8..9edf3aee7e 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -229,6 +229,7 @@ class MapUnit { // if we don't remove the unit before the check it's return false! val unitToUpgradeTo = getUnitToUpgradeTo() + if (name == unitToUpgradeTo.name) return false civInfo.removeUnit(this) val canUpgrade = unitToUpgradeTo.isBuildable(civInfo) civInfo.addUnit(this)