… | |
… | |
138 | } |
138 | } |
139 | |
139 | |
140 | static void |
140 | static void |
141 | clear_map (player *pl) |
141 | clear_map (player *pl) |
142 | { |
142 | { |
143 | client &socket = *pl->socket; |
|
|
144 | |
|
|
145 | memset (&socket.lastmap, 0, sizeof (socket.lastmap)); |
143 | memset (&pl->socket->lastmap, 0, sizeof (pl->socket->lastmap)); |
146 | |
144 | |
147 | if (socket.newmapcmd == 1) |
145 | if (pl->socket->newmapcmd == 1) |
148 | socket.send_packet ("newmap"); |
146 | pl->socket->send_packet ("newmap"); |
149 | |
147 | |
150 | socket.update_look = 1; |
148 | pl->socket->floorbox_reset (); |
151 | socket.look_position = 0; |
|
|
152 | } |
149 | } |
153 | |
150 | |
154 | /** check for map change and send new map data */ |
151 | /** check for map change and send new map data */ |
155 | static void |
152 | static void |
156 | check_map_change (player *pl) |
153 | check_map_change (player *pl) |
… | |
… | |
197 | if (socket.buggy_mapscroll && (abs (dx) > 8 || abs (dy) > 8)) |
194 | if (socket.buggy_mapscroll && (abs (dx) > 8 || abs (dy) > 8)) |
198 | clear_map (pl); // current (<= 1.9.1) clients have unchecked buffer overflows |
195 | clear_map (pl); // current (<= 1.9.1) clients have unchecked buffer overflows |
199 | else |
196 | else |
200 | { |
197 | { |
201 | socket_map_scroll (&socket, ob->x - socket.current_x, ob->y - socket.current_y); |
198 | socket_map_scroll (&socket, ob->x - socket.current_x, ob->y - socket.current_y); |
202 | socket.update_look = 1; |
199 | socket.floorbox_reset (); |
203 | socket.look_position = 0; |
|
|
204 | } |
200 | } |
205 | } |
201 | } |
206 | |
202 | |
207 | socket.current_x = ob->x; |
203 | socket.current_x = ob->x; |
208 | socket.current_y = ob->y; |
204 | socket.current_y = ob->y; |
… | |
… | |
254 | |
250 | |
255 | void |
251 | void |
256 | ExtCmd (char *buf, int len, player *pl) |
252 | ExtCmd (char *buf, int len, player *pl) |
257 | { |
253 | { |
258 | INVOKE_PLAYER (EXTCMD, pl, ARG_DATA (buf, len)); |
254 | INVOKE_PLAYER (EXTCMD, pl, ARG_DATA (buf, len)); |
|
|
255 | } |
|
|
256 | |
|
|
257 | void |
|
|
258 | ExtiCmd (char *buf, int len, client *ns) |
|
|
259 | { |
|
|
260 | INVOKE_CLIENT (EXTICMD, ns, ARG_DATA (buf, len)); |
259 | } |
261 | } |
260 | |
262 | |
261 | void |
263 | void |
262 | MapInfoCmd (char *buf, int len, player *pl) |
264 | MapInfoCmd (char *buf, int len, player *pl) |
263 | { |
265 | { |