From 9fbd569e1fafbf408cbdc7718f221896d351c41b Mon Sep 17 00:00:00 2001 From: JackRainy Date: Sat, 29 Feb 2020 20:10:24 +0200 Subject: [PATCH] Allow to buy buildings from the queue (#2032) * Allow to buy buildings from the queue * Minor refactoring --- core/src/com/unciv/models/ruleset/Building.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index e3632b2e50..7342ff01c4 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -223,8 +223,10 @@ class Building : NamedStats(), IConstruction{ } - override fun shouldBeDisplayed(construction: CityConstructions): Boolean { - val rejectionReason = getRejectionReason(construction) + override fun shouldBeDisplayed(cityConstructions: CityConstructions): Boolean { + if (cityConstructions.isBeingConstructedOrEnqueued(name)) + return false + val rejectionReason = getRejectionReason(cityConstructions) return rejectionReason=="" || rejectionReason.startsWith("Requires") || rejectionReason == "Wonder is being built elsewhere" @@ -232,8 +234,6 @@ class Building : NamedStats(), IConstruction{ fun getRejectionReason(construction: CityConstructions):String{ if (construction.isBuilt(name)) return "Already built" - if (construction.isBeingConstructed(name)) return "Is being built" - if (construction.isEnqueued(name)) return "Already enqueued" val cityCenter = construction.cityInfo.getCenterTile() if ("Must be next to desert" in uniques