diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-31 14:06:22 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-31 14:06:22 +0100 |
commit | 2622a3c602ae14a278e7f201a678f9b18dc2ec25 (patch) | |
tree | 43582e1eaf718d55aa5568894fc852888db7619e /FICS/playerdb.c | |
parent | 6e0ab494d3ef43ef37d25ce5249dd6d5a1ce1bd8 (diff) |
Reformatted player_goto_prev_board()
Diffstat (limited to 'FICS/playerdb.c')
-rw-r--r-- | FICS/playerdb.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c index fd36646..cbd6937 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -1794,28 +1794,34 @@ PUBLIC int player_goto_next_board(int p) return player_goto_board(p, on); } -PUBLIC int player_goto_prev_board(int p) +PUBLIC int +player_goto_prev_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 < 0) - on = (parray[p].simul_info.numBoards) - 1; - 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 previous board.\n"); - return -1; - } - return player_goto_board(p, on); + on = parray[p].simul_info.onBoard; + start = on; + g = -1; + + do { + --on; + + if (on < 0) + on = (parray[p].simul_info.numBoards) - 1; + + if ((g = parray[p].simul_info.boards[on]) >= 0) + break; + } while (start != on); + + if (g == -1) { + pprintf(p, "\nMajor Problem! Can't find your previous board." + "\n"); + return -1; + } + + return player_goto_board(p, on); } PUBLIC int |