diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-03-30 11:00:15 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-03-30 11:00:15 +0100 |
commit | 38336bca419e34f6a637dd913e6bcd7e8b0ebae9 (patch) | |
tree | 8ece035f7ec9a7eb13f4d8f8a72d7e43d6fe4376 /FICS/gameproc.c | |
parent | 6b203dbffb61f7afe1aa3acffdc9958e493634f2 (diff) |
Reformatted com_goboard()
Diffstat (limited to 'FICS/gameproc.c')
-rw-r--r-- | FICS/gameproc.c | 77 |
1 files changed, 44 insertions, 33 deletions
diff --git a/FICS/gameproc.c b/FICS/gameproc.c index 931679a..9b8ae15 100644 --- a/FICS/gameproc.c +++ b/FICS/gameproc.c @@ -1523,41 +1523,52 @@ if 0 is the incorrect 4th arg, please fix :) */ return COM_OK; } -PUBLIC int com_goboard(int p, param_list param) +PUBLIC int +com_goboard(int p, param_list param) { - int on, g, p1; + int on, g, p1; - if (!parray[p].simul_info.numBoards) { - pprintf(p, "You are not giving a simul.\n"); - return COM_OK; - } - p1 = player_find_part_login(param[0].val.word); - if (p1 < 0) { - pprintf(p, "No user named \"%s\" is logged in.\n", param[0].val.word); - return COM_OK; - } - if (p == p1) { - pprintf(p, "You can't goboard yourself!\n"); - return COM_OK; - } - on = parray[p].simul_info.onBoard; - g = parray[p].simul_info.boards[on]; - if (p1 == garray[g].black) { - pprintf(p, "You are already at that board!\n"); - return COM_OK; - } - if (parray[p].simul_info.numBoards > 1) { - player_decline_offers(p, -1, -PEND_SIMUL); - if (player_goto_simulgame_bynum(p, parray[p1].game) !=-1) { - if (g >= 0) { - pprintf(garray[g].black, "\n"); - pprintf_highlight(garray[g].black, "%s", parray[p].name); - pprintf_prompt(garray[g].black, " has moved away from your board.\n"); - } - } - } 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; + } + + p1 = player_find_part_login(param[0].val.word); + + if (p1 < 0) { + pprintf(p, "No user named \"%s\" is logged in.\n", + param[0].val.word); + return COM_OK; + } + + if (p == p1) { + pprintf(p, "You can't goboard yourself!\n"); + return COM_OK; + } + + on = parray[p].simul_info.onBoard; + g = parray[p].simul_info.boards[on]; + + if (p1 == garray[g].black) { + pprintf(p, "You are already at that board!\n"); + return COM_OK; + } + + if (parray[p].simul_info.numBoards > 1) { + player_decline_offers(p, -1, -PEND_SIMUL); + + if (player_goto_simulgame_bynum(p, parray[p1].game) != -1) { + if (g >= 0) { + pprintf(garray[g].black, "\n"); + pprintf_highlight(garray[g].black, "%s", + parray[p].name); + pprintf_prompt(garray[g].black, " has moved " + "away from your board.\n"); + } + } + } else + pprintf(p, "You are only playing one board!\n"); + return COM_OK; } PUBLIC int |