… | |
… | |
87 | client::handle_command () |
87 | client::handle_command () |
88 | { |
88 | { |
89 | bool skipping = false; |
89 | bool skipping = false; |
90 | |
90 | |
91 | while (!cmd_queue.empty () |
91 | while (!cmd_queue.empty () |
92 | && !(state == ST_PLAYING && pl->ob && pl->ob->speed_left < 0)) |
92 | && !(state == ST_PLAYING && pl->ob && pl->ob->speed_left <= 0)) |
93 | { |
93 | { |
94 | command &cmd = cmd_queue.front (); |
94 | command &cmd = cmd_queue.front (); |
95 | |
95 | |
96 | if (cmd.stamp + MAX_QUEUE_BACKLOG < now ()) |
96 | if (cmd.stamp + MAX_QUEUE_BACKLOG < now ()) |
97 | { |
97 | { |
… | |
… | |
143 | client *s = clients [i]; |
143 | client *s = clients [i]; |
144 | player *pl = s->pl; |
144 | player *pl = s->pl; |
145 | |
145 | |
146 | if (pl && pl->ns && !pl->ns->destroyed ()) |
146 | if (pl && pl->ns && !pl->ns->destroyed ()) |
147 | { |
147 | { |
|
|
148 | client *ns = pl->ns; |
|
|
149 | |
148 | /* Update the players stats once per tick. More efficient than |
150 | /* Update the players stats once per tick. More efficient than |
149 | * sending them whenever they change, and probably just as useful |
151 | * sending them whenever they change, and probably just as useful |
150 | */ |
152 | */ |
151 | esrv_update_stats (pl); |
153 | esrv_update_stats (pl); |
152 | |
154 | |
153 | if (pl->last_weight != -1 && pl->last_weight != WEIGHT (pl->ob)) |
155 | if (ns->last_weight != -1 && ns->last_weight != WEIGHT (pl->ob)) |
154 | { |
156 | { |
155 | esrv_update_item (UPD_WEIGHT, pl->ob, pl->ob); |
157 | esrv_update_item (UPD_WEIGHT, pl->ob, pl->ob); |
156 | if (pl->last_weight != WEIGHT (pl->ob)) |
158 | if (ns->last_weight != WEIGHT (pl->ob)) |
157 | LOG (llevError, "esrv_update_item(UPD_WEIGHT) did not set player weight: is %lu, should be %lu\n", |
159 | LOG (llevError, "esrv_update_item(UPD_WEIGHT) did not set player weight: is %lu, should be %lu\n", |
158 | (unsigned long) pl->last_weight, WEIGHT (pl->ob)); |
160 | (unsigned long) ns->last_weight, WEIGHT (pl->ob)); |
159 | } |
161 | } |
160 | |
162 | |
161 | draw_client_map (pl->ob); |
163 | draw_client_map (pl->ob); |
162 | |
164 | |
163 | if (s->update_look) |
165 | if (s->update_look) |