… | |
… | |
214 | maptile *oldmap = op->map; |
214 | maptile *oldmap = op->map; |
215 | |
215 | |
216 | if (out_of_map (newmap, x, y)) |
216 | if (out_of_map (newmap, x, y)) |
217 | { |
217 | { |
218 | LOG (llevError, "enter_map: supplied coordinates are not within the map! (%s: %d, %d)\n", newmap->path, x, y); |
218 | LOG (llevError, "enter_map: supplied coordinates are not within the map! (%s: %d, %d)\n", newmap->path, x, y); |
219 | x = MAP_ENTER_X (newmap); |
219 | x = newmap->enter_x; |
220 | y = MAP_ENTER_Y (newmap); |
220 | y = newmap->enter_y; |
221 | if (out_of_map (newmap, x, y)) |
221 | if (out_of_map (newmap, x, y)) |
222 | { |
222 | { |
223 | LOG (llevError, "enter_map: map %s provides invalid default enter location (%d, %d) > (%d, %d)\n", |
223 | LOG (llevError, "enter_map: map %s provides invalid default enter location (%d, %d) > (%d, %d)\n", |
224 | newmap->path, x, y, newmap->width, newmap->height); |
224 | newmap->path, x, y, newmap->width, newmap->height); |
225 | new_draw_info (NDI_UNIQUE, 0, op, "The exit is closed"); |
225 | new_draw_info (NDI_UNIQUE, 0, op, "The exit is closed"); |
… | |
… | |
346 | |
346 | |
347 | void |
347 | void |
348 | set_map_timeout (maptile *oldmap) |
348 | set_map_timeout (maptile *oldmap) |
349 | { |
349 | { |
350 | #if MAP_MAXTIMEOUT |
350 | #if MAP_MAXTIMEOUT |
351 | oldmap->timeout = MAP_TIMEOUT (oldmap); |
351 | oldmap->timeout = oldmap->timeout; |
352 | /* Do MINTIMEOUT first, so that MAXTIMEOUT is used if that is |
352 | /* Do MINTIMEOUT first, so that MAXTIMEOUT is used if that is |
353 | * lower than the min value. |
353 | * lower than the min value. |
354 | */ |
354 | */ |
355 | # if MAP_MINTIMEOUT |
355 | # if MAP_MINTIMEOUT |
356 | if (oldmap->timeout < MAP_MINTIMEOUT) |
356 | if (oldmap->timeout < MAP_MINTIMEOUT) |
… | |
… | |
447 | */ |
447 | */ |
448 | if (new_map) |
448 | if (new_map) |
449 | { |
449 | { |
450 | int x, y; |
450 | int x, y; |
451 | |
451 | |
452 | x = EXIT_X (exit_ob) = MAP_ENTER_X (new_map); |
452 | x = EXIT_X (exit_ob) = new_map->enter_x; |
453 | y = EXIT_Y (exit_ob) = MAP_ENTER_Y (new_map); |
453 | y = EXIT_Y (exit_ob) = new_map->enter_y; |
454 | EXIT_PATH (exit_ob) = newmap_name; |
454 | EXIT_PATH (exit_ob) = newmap_name; |
455 | strcpy (new_map->path, newmap_name); |
455 | strcpy (new_map->path, newmap_name); |
456 | enter_map (pl, new_map, x, y); |
456 | enter_map (pl, new_map, x, y); |
457 | } |
457 | } |
458 | } |
458 | } |
… | |
… | |
602 | */ |
602 | */ |
603 | if (new_map) |
603 | if (new_map) |
604 | { |
604 | { |
605 | int x, y; |
605 | int x, y; |
606 | |
606 | |
607 | x = EXIT_X (exit_ob) = MAP_ENTER_X (new_map); |
607 | x = EXIT_X (exit_ob) = new_map->enter_x; |
608 | y = EXIT_Y (exit_ob) = MAP_ENTER_Y (new_map); |
608 | y = EXIT_Y (exit_ob) = new_map->enter_y; |
609 | new_map->templatemap = 1; |
609 | new_map->templatemap = 1; |
610 | enter_map (pl, new_map, x, y); |
610 | enter_map (pl, new_map, x, y); |
611 | } |
611 | } |
612 | } |
612 | } |
613 | |
613 | |
… | |
… | |
809 | * using the new maps default coordinates, the exit ob should use |
809 | * using the new maps default coordinates, the exit ob should use |
810 | * something like -1, -1 so it is clear to do that. |
810 | * something like -1, -1 so it is clear to do that. |
811 | */ |
811 | */ |
812 | if (x == 0 && y == 0) |
812 | if (x == 0 && y == 0) |
813 | { |
813 | { |
814 | x = MAP_ENTER_X (newmap); |
814 | x = newmap->enter_x; |
815 | y = MAP_ENTER_Y (newmap); |
815 | y = newmap->enter_y; |
816 | LOG (llevDebug, "enter_exit: Exit %s (%d,%d) on map %s is 0 destination coordinates\n", |
816 | LOG (llevDebug, "enter_exit: Exit %s (%d,%d) on map %s is 0 destination coordinates\n", |
817 | &exit_ob->name, exit_ob->x, exit_ob->y, exit_ob->map ? exit_ob->map->path : "<nil>"); |
817 | &exit_ob->name, exit_ob->x, exit_ob->y, exit_ob->map ? exit_ob->map->path : "<nil>"); |
818 | } |
818 | } |
819 | |
819 | |
820 | /* mids 02/13/2002 if exit is damned, update players death & WoR home-position and delete town portal */ |
820 | /* mids 02/13/2002 if exit is damned, update players death & WoR home-position and delete town portal */ |