From db1604b0bc67429c77a17cec9bf0654b12241361 Mon Sep 17 00:00:00 2001 From: Aron de Jong Date: Wed, 9 Jun 2021 19:53:19 +0200 Subject: [PATCH] Fix turnsLeft return 0 if 0 < workLeft <= overflow (#4086) --- core/src/com/unciv/logic/city/CityConstructions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/city/CityConstructions.kt b/core/src/com/unciv/logic/city/CityConstructions.kt index bfd0963c60..fa31c5592c 100644 --- a/core/src/com/unciv/logic/city/CityConstructions.kt +++ b/core/src/com/unciv/logic/city/CityConstructions.kt @@ -226,7 +226,7 @@ class CityConstructions { fun turnsToConstruction(constructionName: String, useStoredProduction: Boolean = true): Int { val workLeft = getRemainingWork(constructionName, useStoredProduction) - if (workLeft < 0) // we've done more work than actually necessary - possible if circumstances cause buildings to be cheaper later + if (workLeft <= productionOverflow) // we might have done more work than actually necessary (if <0) - possible if circumstances cause buildings to be cheaper later return 1 // we'll finish this next turn val cityStatsForConstruction: Stats