From 7a9fd14b1315aab16f46112728addf09386f8fa0 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 2 Dec 2019 22:01:16 +0200 Subject: [PATCH] Resolved #1405 - upgrading Spearman to Landsknecht no longer gives you gold --- core/src/com/unciv/logic/city/CityInfo.kt | 1 + core/src/com/unciv/logic/map/MapUnit.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index a3fce4e287..a146797d9a 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -326,6 +326,7 @@ class CityInfo { } isPuppet=false + cityConstructions.inProgressConstructions.clear() // undo all progress of the previous civ on units etc. cityStats.update() UncivGame.Current.worldScreen.shouldUpdate=true } diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index b4e4820545..ea62cc8720 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -238,6 +238,7 @@ class MapUnit { goldCostOfUpgrade = (goldCostOfUpgrade * 0.66f).toInt() if(civInfo.containsBuildingUnique("Gold cost of upgrading military units reduced by 33%")) goldCostOfUpgrade = (goldCostOfUpgrade * 0.66f).toInt() + if(goldCostOfUpgrade<0) return 0 // For instance, Landsknecht costs less than Spearman, so upgrading would cost negative gold return goldCostOfUpgrade }