mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 13:49:54 +07:00
Fix a bug that causes exception when selecting special construction.
This commit is contained in:

committed by
Yair Morgenstern

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)
|
||||
|
Reference in New Issue
Block a user