Skip to content

Commit

Permalink
Translate current side before checking for "next side".
Browse files Browse the repository at this point in the history
  • Loading branch information
riverwanderer committed Sep 6, 2023
1 parent d3e7d20 commit 056be01
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ protected String promptForSide() {
// Common names for Solitaire players (Solitaire, Solo, Referee) do not count as "real" player sides, and will be skipped.
// If we have no "next" side available to offer, we stay with the observer side as our default offering.
boolean found = false; // If we find a usable side
final String mySide = getMySide(); // Get our own side, so we can find the "next" one
final String mySide = translateSide(getMySide()); // Get our own side, so we can find the "next" one
final int myidx = (mySide != null) ? sides.indexOf(mySide) : -1; // See if we have a current non-observe side.
int i = (myidx >= 0) ? ((myidx + 1) % sides.size()) : 0; // If we do, start looking in the "next" slot, otherwise start at beginning.
for (int tries = 0; i != myidx && tries < sides.size(); i = (i + 1) % sides.size(), tries++) { // Wrap-around search of sides
Expand Down

0 comments on commit 056be01

Please sign in to comment.