mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Resolved crash for stats not in statCostModifiers
This commit is contained in:
parent
9d5b3d4e4a
commit
5b5e4137db
@ -32,14 +32,19 @@ class Speed : RulesetObject() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val statCostModifiers: HashMap<Stat, Float> by lazy {
|
val statCostModifiers: HashMap<Stat, Float> by lazy {
|
||||||
HashMap<Stat, Float>().apply {
|
val map = HashMap<Stat, Float>()
|
||||||
this[Stat.Faith] = 1f;
|
for (stat in Stat.values()) {
|
||||||
this[Stat.Production] = productionCostModifier;
|
val modifier = when (stat) {
|
||||||
this[Stat.Gold] = goldCostModifier;
|
Stat.Production -> productionCostModifier
|
||||||
this[Stat.Science] = scienceCostModifier;
|
Stat.Gold -> goldCostModifier
|
||||||
this[Stat.Faith] = faithCostModifier;
|
Stat.Science -> scienceCostModifier
|
||||||
this[Stat.Happiness] = 1f;
|
Stat.Faith -> faithCostModifier
|
||||||
|
else -> 1f
|
||||||
|
}
|
||||||
|
map[stat] = modifier
|
||||||
}
|
}
|
||||||
|
|
||||||
|
map
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user