Skip to content

Commit

Permalink
Fix random key rings always having all enabled (gamestabled#701)
Browse files Browse the repository at this point in the history
The problem was I forgot to unset them during randomization.
  • Loading branch information
Kewlan authored Oct 20, 2023
1 parent 4df3413 commit 3a9f09b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2935,8 +2935,12 @@ void UpdateSettings() {
auto keyRings = keyRingOptions;
Shuffle(keyRings);
auto amount = Random(0, keyRings.size() + 1);
for (size_t i = 0; i < amount; i++) {
keyRings[i]->SetSelectedIndex(ON);
for (size_t i = 0; i < keyRings.size(); i++) {
if (i < amount) {
keyRings[i]->SetSelectedIndex(ON);
} else {
keyRings[i]->SetSelectedIndex(OFF);
}
}
}
if (RingWell) {
Expand Down

0 comments on commit 3a9f09b

Please sign in to comment.