Fixed : unit upgrades to itself with 10 gold.

This commit is contained in:
Duan Tao 2019-03-18 18:40:11 +08:00
parent 3086520bd2
commit 11bb63495b

View File

@ -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)