From 706510b089ccb2fb18b5b98c928914043f6a7c5a Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sat, 30 Mar 2024 12:56:58 +0100 Subject: Reformatted com_unpause() --- FICS/gameproc.c | 53 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'FICS') diff --git a/FICS/gameproc.c b/FICS/gameproc.c index 414f022..603a580 100644 --- a/FICS/gameproc.c +++ b/FICS/gameproc.c @@ -861,30 +861,39 @@ PUBLIC int com_pause(int p, param_list param) return COM_OK; } -PUBLIC int com_unpause(int p, param_list param) +PUBLIC int +com_unpause(int p, param_list param) { - int now; - int g; + int g; + int now; - ASSERT(param[0].type == TYPE_NULL); - if (!pIsPlaying(p)) { - return COM_OK; - } - g = parray[p].game; - if (!garray[g].clockStopped) { - pprintf(p, "Game is not paused.\n"); - return COM_OK; - } - garray[g].clockStopped = 0; - now = tenth_secs(); - if (garray[g].numHalfMoves == 0) - garray[g].timeOfStart = now; - garray[g].lastMoveTime = now; - garray[g].lastDecTime = now; - send_boards(g); - pprintf(p, "Game clock resumed.\n"); - pprintf_prompt(parray[p].opponent, "\nGame clock resumed.\n"); - return COM_OK; + ASSERT(param[0].type == TYPE_NULL); + + if (!pIsPlaying(p)) + return COM_OK; + + g = parray[p].game; + + if (!garray[g].clockStopped) { + pprintf(p, "Game is not paused.\n"); + return COM_OK; + } + + garray[g].clockStopped = 0; + now = tenth_secs(); + + if (garray[g].numHalfMoves == 0) + garray[g].timeOfStart = now; + + garray[g].lastMoveTime = now; + garray[g].lastDecTime = now; + + send_boards(g); + + pprintf(p, "Game clock resumed.\n"); + pprintf_prompt(parray[p].opponent, "\nGame clock resumed.\n"); + + return COM_OK; } PUBLIC int -- cgit v1.2.3