mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 15:01:09 -04:00
Solved another rare concurrency error
This commit is contained in:
parent
8bf09420e0
commit
8d91cb90dc
@ -53,16 +53,18 @@ class CityConstructions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getCityProductionTextForCityButton(): String {
|
fun getCityProductionTextForCityButton(): String {
|
||||||
var result = currentConstruction.tr()
|
val currentConstructionSnapshot = currentConstruction // See below
|
||||||
if (SpecialConstruction.getSpecialConstructions().none { it.name==currentConstruction })
|
var result = currentConstructionSnapshot .tr()
|
||||||
result += "\r\n" + turnsToConstruction(currentConstruction) + " {turns}".tr()
|
if (SpecialConstruction.getSpecialConstructions().none { it.name==currentConstructionSnapshot })
|
||||||
|
result += "\r\n" + turnsToConstruction(currentConstructionSnapshot ) + " {turns}".tr()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getProductionForTileInfo(): String {
|
fun getProductionForTileInfo(): String {
|
||||||
var result = currentConstruction.tr()
|
val currentConstructionSnapshot = currentConstruction // this is because there were rare errors tht I assume were caused because currentContruction changed on another thread
|
||||||
if (SpecialConstruction.getSpecialConstructions().none { it.name==currentConstruction })
|
var result = currentConstructionSnapshot.tr()
|
||||||
result += "\r\n{in} ".tr() + turnsToConstruction(currentConstruction) + " {turns}".tr()
|
if (SpecialConstruction.getSpecialConstructions().none { it.name==currentConstructionSnapshot })
|
||||||
|
result += "\r\n{in} ".tr() + turnsToConstruction(currentConstructionSnapshot) + " {turns}".tr()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user