… | |
… | |
147 | pl->ns->send_packet ("newmap"); |
147 | pl->ns->send_packet ("newmap"); |
148 | |
148 | |
149 | pl->ns->floorbox_reset (); |
149 | pl->ns->floorbox_reset (); |
150 | } |
150 | } |
151 | |
151 | |
152 | /** check for map change and send new map data */ |
152 | /** check for map/region change and send new map data */ |
153 | static void |
153 | static void |
154 | check_map_change (player *pl) |
154 | check_map_change (player *pl) |
155 | { |
155 | { |
156 | client &socket = *pl->ns; |
156 | client &socket = *pl->ns; |
157 | object *ob = pl->ob; |
157 | object *ob = pl->ob; |
… | |
… | |
201 | } |
201 | } |
202 | } |
202 | } |
203 | |
203 | |
204 | socket.current_x = ob->x; |
204 | socket.current_x = ob->x; |
205 | socket.current_y = ob->y; |
205 | socket.current_y = ob->y; |
|
|
206 | |
|
|
207 | region *reg = ob->region (); |
|
|
208 | if (socket.current_region != reg) |
|
|
209 | { |
|
|
210 | socket.current_region = reg; |
|
|
211 | socket.send_packet_printf ("drawinfo 0 You are now %s.\n(use whereami for more details)", ®->longname); |
|
|
212 | } |
206 | } |
213 | } |
207 | |
214 | |
208 | /** |
215 | /** |
209 | * RequestInfo is sort of a meta command. There is some specific |
216 | * RequestInfo is sort of a meta command. There is some specific |
210 | * request of information, but we call other functions to provide |
217 | * request of information, but we call other functions to provide |
… | |
… | |
798 | * commands. |
805 | * commands. |
799 | */ |
806 | */ |
800 | pl->count = 0; |
807 | pl->count = 0; |
801 | |
808 | |
802 | //TODO: schmorp thinks whatever this calculates, it makes no sense at all |
809 | //TODO: schmorp thinks whatever this calculates, it makes no sense at all |
803 | int time = FABS (pl->ob->speed) < 0.001 |
810 | int time = fabs (pl->ob->speed) < 0.001 |
804 | ? time = MAX_TIME * 100 |
811 | ? time = MAX_TIME * 100 |
805 | : time = (int) (MAX_TIME / FABS (pl->ob->speed)); |
812 | : time = (int) (MAX_TIME / fabs (pl->ob->speed)); |
806 | |
813 | |
807 | /* Send confirmation of command execution now */ |
814 | /* Send confirmation of command execution now */ |
808 | packet sl ("comc"); |
815 | packet sl ("comc"); |
809 | sl << uint16 (cmdid) << uint32 (time); |
816 | sl << uint16 (cmdid) << uint32 (time); |
810 | pl->ns->send_packet (sl); |
817 | pl->ns->send_packet (sl); |