diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-03-30 11:34:49 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-03-30 11:34:49 +0100 |
commit | afc45058f8fc8d8d5cadd52913abdf2f891b1af8 (patch) | |
tree | 93a48c85b6581fe22f8d8c77d19ac4dfc737850f /FICS/gameproc.c | |
parent | e72a1467e9f29a61fb72a27d240fd0f0f4d53a00 (diff) |
Reformatted com_time()
Diffstat (limited to 'FICS/gameproc.c')
-rw-r--r-- | FICS/gameproc.c | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/FICS/gameproc.c b/FICS/gameproc.c index cff355b..1277955 100644 --- a/FICS/gameproc.c +++ b/FICS/gameproc.c @@ -1300,34 +1300,38 @@ PUBLIC int com_switch(int p, param_list param) return COM_OK; } -PUBLIC int com_time(int p, param_list param) +PUBLIC int +com_time(int p, param_list param) { - int p1, g; + int p1, g; - if (param[0].type == TYPE_NULL) { - g = parray[p].game; - if (!pIsPlaying(p)) { - return COM_OK; - } - } else { - g = GameNumFromParam(p, &p1, ¶m[0]); - if (g < 0) - return COM_OK; - } - if ((g < 0) || (g >= g_num) || (garray[g].status != GAME_ACTIVE)) { - pprintf(p, "There is no such game.\n"); - return COM_OK; - } - game_update_time(g); - pprintf(p, "White (%s) : %d mins, %d secs\n", - parray[garray[g].white].name, - garray[g].wTime / 600, - (garray[g].wTime - ((garray[g].wTime / 600) * 600)) / 10); - pprintf(p, "Black (%s) : %d mins, %d secs\n", - parray[garray[g].black].name, - garray[g].bTime / 600, - (garray[g].bTime - ((garray[g].bTime / 600) * 600)) / 10); - return COM_OK; + if (param[0].type == TYPE_NULL) { + g = parray[p].game; + + if (!pIsPlaying(p)) + return COM_OK; + } else { + if ((g = GameNumFromParam(p, &p1, ¶m[0])) < 0) + return COM_OK; + } + + if (g < 0 || g >= g_num || garray[g].status != GAME_ACTIVE) { + pprintf(p, "There is no such game.\n"); + return COM_OK; + } + + game_update_time(g); + + pprintf(p, "White (%s) : %d mins, %d secs\n", + parray[garray[g].white].name, + garray[g].wTime / 600, + (garray[g].wTime - ((garray[g].wTime / 600) * 600)) / 10); + pprintf(p, "Black (%s) : %d mins, %d secs\n", + parray[garray[g].black].name, + garray[g].bTime / 600, + (garray[g].bTime - ((garray[g].bTime / 600) * 600)) / 10); + + return COM_OK; } PUBLIC int |