aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-31 14:25:44 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-31 14:25:44 +0100
commit7761d8ab19d9023de23bf8394300a74e55b440bd (patch)
tree81fabdbd97520390f9d9d13c8a06757315ea2944
parent58eec56aaa59cbd7b493f96b4a9499c0a00e35ff (diff)
Reformatted player_remove_observe()
-rw-r--r--FICS/playerdb.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index 048ad38..7f12be5 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -1689,21 +1689,25 @@ PUBLIC int player_add_observe(int p, int g)
return 0;
}
-PUBLIC int player_remove_observe(int p, int g)
+PUBLIC int
+player_remove_observe(int p, int g)
{
- int i;
+ int i;
- for (i = 0; i < parray[p].num_observe; i++) {
- if (parray[p].observe_list[i] == g)
- break;
- }
- if (i == parray[p].num_observe)
- return -1; /* Not found! */
- for (; i < parray[p].num_observe - 1; i++) {
- parray[p].observe_list[i] = parray[p].observe_list[i + 1];
- }
- parray[p].num_observe--;
- return 0;
+ for (i = 0; i < parray[p].num_observe; i++) {
+ if (parray[p].observe_list[i] == g)
+ break;
+ }
+
+ if (i == parray[p].num_observe)
+ return -1; // Not found!
+
+ for (; i < (parray[p].num_observe - 1); i++)
+ parray[p].observe_list[i] = parray[p].observe_list[i + 1];
+
+ parray[p].num_observe--;
+
+ return 0;
}
PUBLIC int