mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Fix a bug that causes exception when selecting special construction.
This commit is contained in:
parent
56f4d2d57b
commit
e511385d12
@ -115,8 +115,11 @@ class CityConstructions {
|
||||
else return 0
|
||||
}
|
||||
|
||||
fun getRemainingWork(constructionName: String) =
|
||||
getConstruction(constructionName).getProductionCost(cityInfo.civInfo) - getWorkDone(constructionName)
|
||||
fun getRemainingWork(constructionName: String): Int {
|
||||
val constr = getConstruction(constructionName)
|
||||
if (constr is SpecialConstruction) return 0
|
||||
return constr.getProductionCost(cityInfo.civInfo) - getWorkDone(constructionName)
|
||||
}
|
||||
|
||||
fun turnsToConstruction(constructionName: String): Int {
|
||||
val workLeft = getRemainingWork(constructionName)
|
||||
|
Loading…
x
Reference in New Issue
Block a user