From db8c3030c674cf173e866ab309990ded906c096e Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 31 Dec 2023 16:51:11 +0100 Subject: Reformatted player_notify() --- FICS/playerdb.c | 53 +++++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 24 deletions(-) (limited to 'FICS/playerdb.c') diff --git a/FICS/playerdb.c b/FICS/playerdb.c index ee20d81..9c6f81e 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -1103,31 +1103,36 @@ PUBLIC int player_notify_present(int p) return count; } -PUBLIC int player_notify(int p, char *note1, char *note2) -/* notify those interested that p has arrived/departed */ -{ - int p1; - int count = 0; +PUBLIC int +player_notify(int p, char *note1, char *note2) +{ // Notify those interested that 'p' has arrived/departed. + int count = 0; + int p1; - if (!parray[p].registered) - return count; - for (p1 = 0; p1 < p_num; p1++) { - if ((player_notified(p1, p)) && (parray[p1].status == PLAYER_PROMPT)) { - if (parray[p1].bell) - pprintf_noformat(p1, "\007"); - pprintf(p1, "\nNotification: "); - pprintf_highlight(p1, "%s", parray[p].name); - pprintf_prompt(p1, " has %s.\n", note1); - if (!count) { - pprintf(p, "Your %s was noted by:", note2); - } - count++; - pprintf(p, " %s", parray[p1].name); - } - } - if (count) - pprintf(p, ".\n"); - return count; + if (!parray[p].registered) + return count; + + for (p1 = 0; p1 < p_num; p1++) { + if (player_notified(p1, p) && parray[p1].status == + PLAYER_PROMPT) { + if (parray[p1].bell) + pprintf_noformat(p1, "\007"); + + pprintf(p1, "\nNotification: "); + pprintf_highlight(p1, "%s", parray[p].name); + pprintf_prompt(p1, " has %s.\n", note1); + + if (!count) + pprintf(p, "Your %s was noted by:", note2); + count++; + + pprintf(p, " %s", parray[p1].name); + } + } + + if (count) + pprintf(p, ".\n"); + return count; } /* -- cgit v1.2.3