Skip to content

Commit

Permalink
Fix random range out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Danand committed Mar 26, 2024
1 parent e5fed04 commit 2df9f78
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,14 @@ class SignalProcessorSensors(
this.frequenciesMax[index] = weightedChoice(frequencyMaxToWeights)
}

var rhythmSeedA = settingsState.rhythmSeedA.value

if (rhythmSeedA < 2) {
rhythmSeedA = 2
}

if (angularSpeedMagnitude > settingsState.sensitivityC.value) {
weirdEffectDivider = Random.nextInt(1, settingsState.rhythmSeedA.value)
weirdEffectDivider = Random.nextInt(1, rhythmSeedA)
}

val sensorGetterMinValue = this.sensorGetterMinValues[this.mapping[index]]
Expand Down

0 comments on commit 2df9f78

Please sign in to comment.