Merge pull request #589 from ninjatao/upgrade_to_itself

Fixed : unit upgrades to itself with 10 gold.
This commit is contained in:
Yair Morgenstern 2019-03-18 16:01:50 +02:00 committed by GitHub
commit fd772a93a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)