diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-03-30 10:47:41 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-03-30 10:47:41 +0100 |
commit | 1bb854384904fc0fddc57af56c88eb1c4413dd4e (patch) | |
tree | 249f5770484b6ad157d5ca91d02c16b45d3d6eeb /FICS/gameproc.c | |
parent | 6740b56a14e66685843460c049f47d0adaa6414a (diff) |
Reformatted functions
Diffstat (limited to 'FICS/gameproc.c')
-rw-r--r-- | FICS/gameproc.c | 79 |
1 files changed, 45 insertions, 34 deletions
diff --git a/FICS/gameproc.c b/FICS/gameproc.c index 17eadf2..dd2122b 100644 --- a/FICS/gameproc.c +++ b/FICS/gameproc.c @@ -1615,46 +1615,57 @@ PUBLIC int com_simnext(int p, param_list param) } -PUBLIC int com_simprev(int p, param_list param) +PUBLIC int +com_simprev(int p, param_list param) { - int on, g; + int on, g; - if (!parray[p].simul_info.numBoards) { - pprintf(p, "You are not giving a simul.\n"); - return COM_OK; - } - if (parray[p].simul_info.numBoards > 1) { - player_decline_offers(p, -1, -PEND_SIMUL); - on = parray[p].simul_info.onBoard; - g = parray[p].simul_info.boards[on]; - if (g >= 0) { - pprintf(garray[g].black, "\n"); - pprintf_highlight(garray[g].black, "%s", parray[p].name); - pprintf_prompt(garray[g].black, " is moving back to the previous board.\n"); - } - player_goto_prev_board(p); - } else - pprintf(p, "You are only playing one board!\n"); - return COM_OK; + if (!parray[p].simul_info.numBoards) { + pprintf(p, "You are not giving a simul.\n"); + return COM_OK; + } + + if (parray[p].simul_info.numBoards > 1) { + player_decline_offers(p, -1, -PEND_SIMUL); + on = parray[p].simul_info.onBoard; + g = parray[p].simul_info.boards[on]; + + if (g >= 0) { + pprintf(garray[g].black, "\n"); + pprintf_highlight(garray[g].black, "%s", + parray[p].name); + pprintf_prompt(garray[g].black, " is moving back to " + "the previous board.\n"); + } + + player_goto_prev_board(p); + } else + pprintf(p, "You are only playing one board!\n"); + return COM_OK; } -PUBLIC int com_simgames(int p, param_list param) +PUBLIC int +com_simgames(int p, param_list param) { - int p1 = p; + int p1 = p; - if (param[0].type == TYPE_WORD) { - if ((p1 = player_find_part_login(param[0].val.word)) < 0) { - pprintf(p, "No player named %s is logged in.\n", param[0].val.word); - return COM_OK; - } - } - if (p1 == p) - pprintf(p, "You are playing %d simultaneous games.\n", - player_num_active_boards(p1)); - else - pprintf(p, "%s is playing %d simultaneous games.\n", parray[p1].name, - player_num_active_boards(p1)); - return COM_OK; + if (param[0].type == TYPE_WORD) { + if ((p1 = player_find_part_login(param[0].val.word)) < 0) { + pprintf(p, "No player named %s is logged in.\n", + param[0].val.word); + return COM_OK; + } + } + + if (p1 == p) { + pprintf(p, "You are playing %d simultaneous games.\n", + player_num_active_boards(p1)); + } else { + pprintf(p, "%s is playing %d simultaneous games.\n", + parray[p1].name, player_num_active_boards(p1)); + } + + return COM_OK; } PUBLIC int |