… | |
… | |
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; |