diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-31 14:10:18 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-31 14:10:18 +0100 |
commit | aa47a84f1d7f6cc016957912bdff1f3bfb5fdca8 (patch) | |
tree | 33b828495139785df4cb0bd2cf79d3af2ed1951e /FICS/playerdb.c | |
parent | 2622a3c602ae14a278e7f201a678f9b18dc2ec25 (diff) |
Reformatted player_goto_next_board()
Diffstat (limited to 'FICS/playerdb.c')
-rw-r--r-- | FICS/playerdb.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c index cbd6937..4f4af1f 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -1770,28 +1770,33 @@ PUBLIC int player_goto_board(int p, int board_num) return 0; } -PUBLIC int player_goto_next_board(int p) +PUBLIC int +player_goto_next_board(int p) { - int on; - int start; - int g; + int g; + int on; + int start; - on = parray[p].simul_info.onBoard; - start = on; - g = -1; - do { - on++; - if (on >= parray[p].simul_info.numBoards) - on = 0; - g = parray[p].simul_info.boards[on]; - if (g >= 0) - break; - } while (start != on); - if (g == -1) { - pprintf(p, "\nMajor Problem! Can't find your next board.\n"); - return -1; - } - return player_goto_board(p, on); + on = parray[p].simul_info.onBoard; + start = on; + g = -1; + + do { + on++; + + if (on >= parray[p].simul_info.numBoards) + on = 0; + + if ((g = parray[p].simul_info.boards[on]) >= 0) + break; + } while (start != on); + + if (g == -1) { + pprintf(p, "\nMajor Problem! Can't find your next board.\n"); + return -1; + } + + return player_goto_board(p, on); } PUBLIC int |