Skip to content

Commit

Permalink
Don't repeat current mode in random choose (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
wopox1337 authored May 5, 2023
1 parent 4756785 commit 42def02
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ static GetNextMode() {
new currentIdx = g_currentRoundModeIdx

if (strcmp(redm_modes_switch, "random") == 0) {
currentIdx = random_num(0, count - 1)
while (currentIdx == g_currentRoundModeIdx) {
currentIdx = random_num(0, count - 1)
}
} else if (strcmp(redm_modes_switch, "sequentially") == 0) {
++currentIdx
currentIdx %= count
Expand Down

0 comments on commit 42def02

Please sign in to comment.