… | |
… | |
134 | #ifdef CS_LOGSTATS |
134 | #ifdef CS_LOGSTATS |
135 | if ((time (NULL) - cst_lst.time_start) >= CS_LOGTIME) |
135 | if ((time (NULL) - cst_lst.time_start) >= CS_LOGTIME) |
136 | write_cs_stats (); |
136 | write_cs_stats (); |
137 | #endif |
137 | #endif |
138 | |
138 | |
139 | /* Go through the players. Let the loop set the next pl value, |
|
|
140 | * since we may remove some |
|
|
141 | */ |
|
|
142 | //TODO: must be handled cleanly elsewhere |
|
|
143 | for (player *pl = first_player; pl; ) |
|
|
144 | { |
|
|
145 | player *npl = pl->next; |
|
|
146 | |
|
|
147 | //TODO: must be handled cleanly elsewhere |
|
|
148 | if (!pl->ns || pl->ns->destroyed ()) |
|
|
149 | { |
|
|
150 | save_player (pl->ob, 0); |
|
|
151 | |
|
|
152 | if (!QUERY_FLAG (pl->ob, FLAG_REMOVED)) |
|
|
153 | { |
|
|
154 | terminate_all_pets (pl->ob); |
|
|
155 | pl->ob->remove (); |
|
|
156 | } |
|
|
157 | |
|
|
158 | leave (pl, 1); |
|
|
159 | final_free_player (pl); |
|
|
160 | } |
|
|
161 | |
|
|
162 | pl = npl; |
|
|
163 | } |
|
|
164 | |
|
|
165 | for (sockvec::iterator i = clients.begin (); i != clients.end (); ) |
139 | for (sockvec::iterator i = clients.begin (); i != clients.end (); ) |
166 | { |
140 | { |
167 | client *s = *i; |
141 | client *s = *i; |
168 | |
142 | |
169 | if (s->destroyed ()) |
143 | if (s->destroyed ()) |