… | |
… | |
58 | * the function that calls this should figure them out. |
58 | * the function that calls this should figure them out. |
59 | */ |
59 | */ |
60 | bool |
60 | bool |
61 | object::enter_map (maptile *newmap, int x, int y) |
61 | object::enter_map (maptile *newmap, int x, int y) |
62 | { |
62 | { |
63 | if (destroyed () || !newmap || newmap->in_memory != MAP_ACTIVE) |
63 | if (destroyed () || !newmap || !newmap->linkable ()) |
64 | return false; |
64 | return false; |
65 | |
65 | |
66 | if (out_of_map (newmap, x, y)) |
66 | if (out_of_map (newmap, x, y)) |
67 | { |
67 | { |
68 | LOG (llevError, "enter_map: supplied coordinates are not within the map! (%s: %d, %d)\n", &newmap->path, x, y); |
68 | LOG (llevError, "enter_map: supplied coordinates are not within the map! (%s: %d, %d)\n", &newmap->path, x, y); |
… | |
… | |
130 | return false; |
130 | return false; |
131 | } |
131 | } |
132 | |
132 | |
133 | enemy = 0; |
133 | enemy = 0; |
134 | |
134 | |
|
|
135 | newmap->activate (); // workaround for activate activating everyhing on the map, includign the palyer on the {link} map |
135 | //newmap->insert (this, x, y); |
136 | //newmap->insert (this, x, y); |
136 | newmap->insert (this, x, y, 0, INS_NO_AUTO_EXIT); |
137 | newmap->insert (this, x, y, 0, INS_NO_AUTO_EXIT); |
137 | prefetch_surrounding_maps (); |
138 | prefetch_surrounding_maps (); |
138 | |
139 | |
139 | if (map == newmap) // see if we actually arrived there - insert might trigger a teleport |
140 | if (map == newmap) // see if we actually arrived there - insert might trigger a teleport |