… | |
… | |
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 | //TODO: should not be done here, either |
139 | //TODO: should not be done here, either |
140 | for (sockvec::iterator i = clients.begin (); i != clients.end (); ++i) |
140 | for (int i = 0; i < clients.size (); ++i) |
141 | { |
141 | { |
142 | client *s = *i; |
142 | client *s = clients [i]; |
|
|
143 | player *pl = s->pl; |
143 | |
144 | |
144 | if (player *pl = s->pl) |
145 | if (pl && pl->ns && !pl->ns->destroyed ()) |
145 | { |
146 | { |
146 | /* Update the players stats once per tick. More efficient than |
147 | /* Update the players stats once per tick. More efficient than |
147 | * sending them whenever they change, and probably just as useful |
148 | * sending them whenever they change, and probably just as useful |
148 | */ |
149 | */ |
149 | esrv_update_stats (pl); |
150 | esrv_update_stats (pl); |