diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-31 16:18:41 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-31 16:18:41 +0100 |
commit | 622441fe3925e711a90f6bf791146d0f32d154bd (patch) | |
tree | ce6de132895857a62fed1ae82d4697c72bdccd5b /FICS | |
parent | 7ee5e7e26c106fb58bb87aa47c9fa902c1b94efb (diff) |
Reformatted player_count() and switched to a while loop
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/playerdb.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c index a1d3e9a..4e69e57 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -1180,20 +1180,25 @@ PUBLIC int showstored(int p) } -PUBLIC int player_count(int CountAdmins) +PUBLIC int +player_count(int CountAdmins) { - int count; - int i; + int count; + int i; - for (count = 0, i = 0; i < p_num; i++) { - if ((parray[i].status == PLAYER_PROMPT) && - (CountAdmins || !in_list(i, L_ADMIN, parray[i].name))) - count++; - } - if (count > player_high) - player_high = count; + count = 0; + i = 0; - return count; + while (i < p_num) { + if (parray[i].status == PLAYER_PROMPT && + (CountAdmins || !in_list(i, L_ADMIN, parray[i].name))) + count++; + i++; + } + + if (count > player_high) + player_high = count; + return count; } PUBLIC int |