diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-04-14 12:29:16 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-04-14 12:29:16 +0200 |
commit | 480ae9485107b6d91dca3f1c2aa6be0eb96627ca (patch) | |
tree | 8e925f13868aa6f7ab73565b8ccd354805434680 /FICS/talkproc.c | |
parent | 9cca33cc977879915bc4be5d78e197a619f9f54b (diff) |
Reformatted com_whisper()
Diffstat (limited to 'FICS/talkproc.c')
-rw-r--r-- | FICS/talkproc.c | 69 |
1 files changed, 39 insertions, 30 deletions
diff --git a/FICS/talkproc.c b/FICS/talkproc.c index 3a20b91..4ccdeb2 100644 --- a/FICS/talkproc.c +++ b/FICS/talkproc.c @@ -419,38 +419,47 @@ PRIVATE int chtell(int p, int ch, char *msg) return COM_OK; } -PUBLIC int com_whisper(int p, param_list param) +PUBLIC int +com_whisper(int p, param_list param) { - int g; - int p1; - int count = 0; + int count = 0; + int g; + int p1; - if (!parray[p].num_observe && parray[p].game < 0) { - pprintf(p, "You are not playing or observing a game.\n"); - return COM_OK; - } - if (!parray[p].registered && (parray[p].game == -1)) { - pprintf(p, "You must be registered to whisper other people's games.\n"); - return COM_OK; - } - if (parray[p].game >= 0) - g = parray[p].game; - else - g = parray[p].observe_list[0]; - for (p1 = 0; p1 < p_num; p1++) { - if (p1 == p) - continue; - if (parray[p1].status != PLAYER_PROMPT) - continue; - if (player_is_observe(p1, g) || - (garray[g].link >= 0 && player_is_observe(p1, garray[g].link))) { - tell(p, p1, param[0].val.string, TELL_WHISPER, 0); - if ((parray[p].adminLevel >= ADMIN_ADMIN) || !garray[g].private) - count++; - } - } - pprintf(p, "whispered to %d.\n", count); - return COM_OK; + if (!parray[p].num_observe && parray[p].game < 0) { + pprintf(p, "You are not playing or observing a game.\n"); + return COM_OK; + } + + if (!parray[p].registered && (parray[p].game == -1)) { + pprintf(p, "You must be registered to whisper other people's " + "games.\n"); + return COM_OK; + } + + if (parray[p].game >= 0) + g = parray[p].game; + else + g = parray[p].observe_list[0]; + + for (p1 = 0; p1 < p_num; p1++) { + if (p1 == p) + continue; + if (parray[p1].status != PLAYER_PROMPT) + continue; + if (player_is_observe(p1, g) || + (garray[g].link >= 0 && + player_is_observe(p1, garray[g].link))) { + tell(p, p1, param[0].val.string, TELL_WHISPER, 0); + + if (parray[p].adminLevel >= ADMIN_ADMIN || + !garray[g].private) + count++; + } + } + + pprintf(p, "whispered to %d.\n", count); + return COM_OK; } PUBLIC int |