--- deliantra/server/random_maps/room_gen_onion.C 2008/04/11 21:09:53 1.13 +++ deliantra/server/random_maps/room_gen_onion.C 2008/04/14 22:41:17 1.14 @@ -62,12 +62,15 @@ void draw_onion (char **maze, float *xlocations, float *ylocations, int layers); void make_doors (char **maze, float *xlocations, float *ylocations, int layers, int options); -Maze -map_gen_onion (int xsize, int ysize, int option, int layers) +void +map_gen_onion (Maze maze, int option, int layers) { int i, j; - Maze maze (xsize, ysize); + int xsize = maze->w; + int ysize = maze->h; + + maze->clear (); /* pick some random options if option = 0 */ if (option == 0) @@ -91,13 +94,10 @@ /* write the outer walls, if appropriate. */ if (!(option & RMOPT_WALL_OFF)) - { - for (i = 0; i < xsize; i++) maze[i][0] = maze[i][ysize - 1] = '#'; - for (j = 0; j < ysize; j++) maze[0][j] = maze[xsize - 1][j] = '#'; - }; + maze->border (); if (option & RMOPT_WALLS_ONLY) - return maze; + return; /* pick off the mutually exclusive options */ if (option & RMOPT_BOTTOM_R) @@ -106,8 +106,6 @@ bottom_centered_onion (maze, xsize, ysize, option, layers); else if (option & RMOPT_CENTERED) centered_onion (maze, xsize, ysize, option, layers); - - return maze; } void