aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-01-03 22:33:15 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-01-03 22:33:15 +0100
commit906d765382233c07db7bfd74164e3a66e8abbfb9 (patch)
tree02455593df066f32a34179061a8764d44eb10544 /FICS
parentc0b5fe46be5a036efdca00da4390ac3f8f844e03 (diff)
Reformatted who_ok()
Diffstat (limited to 'FICS')
-rw-r--r--FICS/comproc.c84
1 files changed, 47 insertions, 37 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c
index 4041a5b..c89a21d 100644
--- a/FICS/comproc.c
+++ b/FICS/comproc.c
@@ -918,45 +918,55 @@ who_winloss(int p, int num, int plist[])
pprintf(p, " %3d Players Displayed.\n", num);
}
-PRIVATE int who_ok(int p, unsigned int sel_bits)
+PRIVATE int
+who_ok(int p, unsigned int sel_bits)
{
- int p2;
- if (parray[p].status != PLAYER_PROMPT)
- return 0;
- if (sel_bits == WHO_ALL)
- return 1;
- if (sel_bits & WHO_OPEN)
- if (!parray[p].open)
- return 0;
- if (sel_bits & WHO_CLOSED)
- if (parray[p].open)
- return 0;
- if (sel_bits & WHO_RATED)
- if (!parray[p].rated)
- return 0;
- if (sel_bits & WHO_UNRATED)
- if (parray[p].rated)
- return 0;
- if (sel_bits & WHO_FREE)
- if (parray[p].game >= 0)
- return 0;
- if (sel_bits & WHO_PLAYING)
- if (parray[p].game < 0)
- return 0;
- if (sel_bits & WHO_REGISTERED)
- if (!parray[p].registered)
- return 0;
- if (sel_bits & WHO_UNREGISTERED)
- if (parray[p].registered)
- return 0;
- if (sel_bits & WHO_BUGTEAM) {
- p2 = parray[p].partner;
- if (p2 < 0 || parray[p2].partner != p)
- return 0;
- }
- return 1;
-}
+ int p2;
+ if (parray[p].status != PLAYER_PROMPT)
+ return 0;
+ if (sel_bits == WHO_ALL)
+ return 1;
+
+ if (sel_bits & WHO_OPEN) {
+ if (!parray[p].open)
+ return 0;
+ }
+ if (sel_bits & WHO_CLOSED) {
+ if (parray[p].open)
+ return 0;
+ }
+ if (sel_bits & WHO_RATED) {
+ if (!parray[p].rated)
+ return 0;
+ }
+ if (sel_bits & WHO_UNRATED) {
+ if (parray[p].rated)
+ return 0;
+ }
+ if (sel_bits & WHO_FREE) {
+ if (parray[p].game >= 0)
+ return 0;
+ }
+ if (sel_bits & WHO_PLAYING) {
+ if (parray[p].game < 0)
+ return 0;
+ }
+ if (sel_bits & WHO_REGISTERED) {
+ if (!parray[p].registered)
+ return 0;
+ }
+ if (sel_bits & WHO_UNREGISTERED) {
+ if (parray[p].registered)
+ return 0;
+ }
+ if (sel_bits & WHO_BUGTEAM) {
+ if ((p2 = parray[p].partner) < 0 || parray[p2].partner != p)
+ return 0;
+ }
+
+ return 1;
+}
PRIVATE int
blitz_cmp(const void *pp1, const void *pp2)