Fix turnsLeft return 0 if 0 < workLeft <= overflow (#4086)

This commit is contained in:
Aron de Jong 2021-06-09 19:53:19 +02:00 committed by GitHub
parent 68a3e09a19
commit db1604b0bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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