aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/playerdb.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-31 17:04:38 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-31 17:04:38 +0100
commit75b2226b0010c3bcd18ad27a3babeb8363ca58d4 (patch)
tree57ced75031cef73b074042747efd7ed405f1b43b /FICS/playerdb.c
parent1e87b33b12f7f6504c057914e00a5585f17147ee (diff)
Reformatted player_notify_present()
Diffstat (limited to 'FICS/playerdb.c')
-rw-r--r--FICS/playerdb.c59
1 files changed, 32 insertions, 27 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index 558788e..590ac7c 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -1072,35 +1072,40 @@ PUBLIC void player_notify_departure(int p)
}
}
-PUBLIC int player_notify_present(int p)
-/* output Your arrival was notified by..... */
-/* also notify those with notifiedby set if necessary */
+PUBLIC int
+player_notify_present(int p)
{
- int p1;
- int count = 0;
+ int count = 0;
+ int p1;
- if (!parray[p].registered)
- return count;
- for (p1 = 0; p1 < p_num; p1++) {
- if ((player_notified(p, p1)) && (parray[p1].status == PLAYER_PROMPT)) {
- if (!count) {
- pprintf(p, "Present company includes:");
- }
- count++;
- pprintf(p, " %s", parray[p1].name);
- if ((parray[p1].notifiedby) && (!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 arrived and isn't on your notify list.\n");
- }
- }
- }
- if (count)
- pprintf(p, ".\n");
- return count;
+ if (!parray[p].registered)
+ return count;
+
+ for (p1 = 0; p1 < p_num; p1++) {
+ if (player_notified(p, p1) && parray[p1].status ==
+ PLAYER_PROMPT) {
+ if (!count)
+ pprintf(p, "Present company includes:");
+ count++;
+
+ pprintf(p, " %s", parray[p1].name);
+
+ if (parray[p1].notifiedby &&
+ !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 arrived and isn't on "
+ "your notify list.\n");
+ }
+ }
+ }
+
+ if (count)
+ pprintf(p, ".\n");
+ return count;
}
PUBLIC int