Make stateBasedRandom depend on turn (#11603)

This commit is contained in:
SomeTroglodyte 2024-05-21 18:38:39 +02:00 committed by GitHub
parent 99d937ee1f
commit ca1a2816c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,7 +45,7 @@ object Conditionals {
val gameInfo by lazy { relevantCiv?.gameInfo }
val stateBasedRandom by lazy { Random(state.hashCode()) }
val stateBasedRandom by lazy { Random(state.hashCode() * 31 + (gameInfo?.turns?.hashCode() ?: 0)) }
fun getResourceAmount(resourceName: String): Int {
if (relevantCity != null) return relevantCity!!.getAvailableResourceAmount(resourceName)