diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-04-28 14:15:48 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-04-28 14:15:48 +0200 |
commit | 4a7abb5c3ece0e71bb9bea24d3649c35e53513a1 (patch) | |
tree | 0b6007c8b871484b3527e20f4962bdbc3ccc65f7 /FICS/obsproc.c | |
parent | c084e783191926105545853df1dd200cdf08a4e7 (diff) |
Reformatted com_unexamine()
Diffstat (limited to 'FICS/obsproc.c')
-rw-r--r-- | FICS/obsproc.c | 77 |
1 files changed, 45 insertions, 32 deletions
diff --git a/FICS/obsproc.c b/FICS/obsproc.c index 184712c..49ddb13 100644 --- a/FICS/obsproc.c +++ b/FICS/obsproc.c @@ -343,40 +343,53 @@ PUBLIC int com_allobservers(int p, param_list param) return COM_OK; } -PUBLIC int com_unexamine(int p, param_list param) +PUBLIC int +com_unexamine(int p, param_list param) { - int g, p1, flag = 0; + int g, p1, flag = 0; - if ((parray[p].game <0) ||(garray[parray[p].game].status != GAME_EXAMINE)) { - pprintf(p, "You are not examining any games.\n"); - return COM_OK; - } - g = parray[p].game; - parray[p].game = -1; - for (p1 = 0; p1 < p_num; p1++) { - if (parray[p1].status != PLAYER_PROMPT) - continue; - if ((parray[p1].game == g) &&(p != p1)) { - /* ok - there are other examiners to take over the game */ - flag = 1; - } - if ((player_is_observe(p1, g)) || (parray[p1].game == g)) { - pprintf(p1, "%s stopped examining game %d.\n", parray[p].name, g + 1); - } - } - if (!flag) { - for (p1 = 0; p1 < p_num; p1++) { - if (parray[p1].status != PLAYER_PROMPT) - continue; - if (player_is_observe(p1, g)) { - pprintf(p1, "There are no examiners.\n"); - pcommand(p1, "unobserve %d", g + 1); - } - } - game_remove(g); - } - pprintf(p, "You are no longer examining game %d.\n", g + 1); - return COM_OK; + if (parray[p].game < 0 || garray[parray[p].game].status != + GAME_EXAMINE) { + pprintf(p, "You are not examining any games.\n"); + return COM_OK; + } + + g = parray[p].game; + parray[p].game = -1; + + for (p1 = 0; p1 < p_num; p1++) { + if (parray[p1].status != PLAYER_PROMPT) + continue; + + if (parray[p1].game == g && p != p1) { + /* + * ok - there are other examiners to take over + * the game. + */ + flag = 1; + } + + if (player_is_observe(p1, g) || parray[p1].game == g) { + pprintf(p1, "%s stopped examining game %d.\n", + parray[p].name, (g + 1)); + } + } + + if (!flag) { + for (p1 = 0; p1 < p_num; p1++) { + if (parray[p1].status != PLAYER_PROMPT) + continue; + if (player_is_observe(p1, g)) { + pprintf(p1, "There are no examiners.\n"); + pcommand(p1, "unobserve %d", (g + 1)); + } + } + + game_remove(g); + } + + pprintf(p, "You are no longer examining game %d.\n", (g + 1)); + return COM_OK; } PUBLIC int |