… | |
… | |
891 | for (maprect *rect = map->split_to_tiles (mapwalk_buf, |
891 | for (maprect *rect = map->split_to_tiles (mapwalk_buf, |
892 | op->x - range , op->y - range , |
892 | op->x - range , op->y - range , |
893 | op->x + range + 1, op->y + range + 1); |
893 | op->x + range + 1, op->y + range + 1); |
894 | rect->m; |
894 | rect->m; |
895 | ++rect) |
895 | ++rect) |
|
|
896 | { |
896 | rect->m->touch (); |
897 | rect->m->touch (); |
|
|
898 | rect->m->activate (); |
|
|
899 | } |
897 | } |
900 | } |
898 | |
901 | |
899 | // prefetch a generous area around the player, also up and down |
902 | // prefetch a generous area around the player, also up and down |
900 | static void |
903 | void |
901 | prefetch_surrounding_maps (object *op) |
904 | object::prefetch_surrounding_maps () |
902 | { |
905 | { |
903 | prefetch_surrounding_area (op, op->map, 40); |
906 | prefetch_surrounding_area (this, map, 40); |
904 | |
907 | |
905 | if (maptile *m = op->map->tile_available (TILE_DOWN)) |
908 | if (maptile *m = map->tile_available (TILE_DOWN)) |
906 | prefetch_surrounding_area (op, m, 20); |
909 | prefetch_surrounding_area (this, m, 20); |
907 | |
910 | |
908 | if (maptile *m = op->map->tile_available (TILE_UP)) |
911 | if (maptile *m = map->tile_available (TILE_UP)) |
909 | prefetch_surrounding_area (op, m, 20); |
912 | prefetch_surrounding_area (this, m, 20); |
910 | } |
913 | } |
911 | |
914 | |
912 | //+GPL |
915 | //+GPL |
913 | |
916 | |
914 | /** |
917 | /** |
… | |
… | |
929 | return; |
932 | return; |
930 | |
933 | |
931 | int startlen, oldlen; |
934 | int startlen, oldlen; |
932 | |
935 | |
933 | check_map_change (pl); |
936 | check_map_change (pl); |
934 | prefetch_surrounding_maps (pl->ob); |
937 | pl->ob->prefetch_surrounding_maps (); |
935 | |
938 | |
936 | /* do LOS after calls to update_position */ |
939 | /* do LOS after calls to update_position */ |
937 | /* unfortunately, we need to udpate los when observing, currently */ |
940 | /* unfortunately, we need to udpate los when observing, currently */ |
938 | if (pl->do_los || pl->viewpoint != pl->ob) |
941 | if (pl->do_los || pl->viewpoint != pl->ob) |
939 | { |
942 | { |