--- deliantra/server/random_maps/exit.C 2006/09/16 22:24:12 1.7 +++ deliantra/server/random_maps/exit.C 2006/12/30 10:16:11 1.12 @@ -108,11 +108,6 @@ } } - - - - - /* orientation: 0 means random, 1 means descending dungeon 2 means ascending dungeon @@ -121,9 +116,8 @@ 5 means northward 6 means southward */ - void -place_exits (maptile *map, char **maze, char *exitstyle, int orientation, RMParms * RP) +place_exits (maptile *map, char **maze, char *exitstyle, int orientation, RMParms *RP) { char styledirname[256]; maptile *style_map_down = 0; /* harder maze */ @@ -264,8 +258,8 @@ maze[the_exit_up->x][the_exit_up->y] = '<'; /* set the starting x,y for this map */ - MAP_ENTER_X (map) = the_exit_up->x; - MAP_ENTER_Y (map) = the_exit_up->y; + map->enter_x = the_exit_up->x; + map->enter_y = the_exit_up->y; /* first, look for a '>' character */ find_in_layout (0, '>', &downx, &downy, maze, RP); @@ -333,13 +327,14 @@ /* set the exit down. */ #endif /* load it */ - if ((new_map = ready_map_name (RP->final_map, 0)) == NULL) + if (!(new_map = maptile::find_map (RP->final_map, 0))) return; + new_map->load (); + the_exit_down->slaying = RP->final_map; - strcpy (new_map->path, RP->final_map); - for (tmp = GET_MAP_OB (new_map, MAP_ENTER_X (new_map), MAP_ENTER_Y (new_map)); tmp; tmp = tmp->above) + for (tmp = new_map->at (new_map->enter_x, new_map->enter_y).bot; tmp; tmp = tmp->above) /* Remove exit back to previous random map. There should only be one * which is why we break out. To try to process more than one * would require keeping a 'next' pointer, ad free_object kills tmp, which @@ -347,8 +342,7 @@ */ if (tmp->type == EXIT && EXIT_PATH (tmp) && !strncmp (EXIT_PATH (tmp), "/random/", 8)) { - remove_ob (tmp); - free_object (tmp); + tmp->destroy (); break; } @@ -358,8 +352,8 @@ the_exit_back->slaying = map->path; the_exit_back->stats.hp = the_exit_down->x; the_exit_back->stats.sp = the_exit_down->y; - the_exit_back->x = MAP_ENTER_X (new_map); - the_exit_back->y = MAP_ENTER_Y (new_map); + the_exit_back->x = new_map->enter_x; + the_exit_back->y = new_map->enter_y; insert_ob_in_map (the_exit_back, new_map, NULL, 0); } @@ -378,8 +372,6 @@ } - - /* this function unblocks the exits. We blocked them to keep things from being dumped on them during the other phases of random map generation. */ @@ -393,7 +385,7 @@ for (j = 0; j < RP->Ysize; j++) if (maze[i][j] == '>' || maze[i][j] == '<') { - for (walk = get_map_ob (map, i, j); walk != NULL; walk = walk->above) + for (walk = GET_MAP_OB (map, i, j); walk != NULL; walk = walk->above) { if (walk->move_block == MOVE_ALL && walk->type != LOCKED_DOOR) {