--- deliantra/server/random_maps/room_gen_spiral.C 2008/04/11 21:09:53 1.12 +++ deliantra/server/random_maps/room_gen_spiral.C 2008/04/14 22:41:17 1.13 @@ -51,8 +51,8 @@ extern int surround_check (char **maze, int i, int j, int xsize, int ysize); -Maze -map_gen_spiral (int xsize, int ysize, int option) +void +map_gen_spiral (Maze maze, int option) { int i, j; float parm = 0; @@ -61,12 +61,11 @@ float SizeX, SizeY; float xscale, yscale; - Maze maze (xsize, ysize); - /* slightly easier to fill and then cut */ - for (i = 0; i < xsize; i++) - for (j = 0; j < ysize; j++) - maze[i][j] = '#'; + maze->clear ('#'); + + int xsize = maze->w; + int ysize = maze->h; ic = xsize / 2; jc = ysize / 2; @@ -122,15 +121,13 @@ y = parm * sin (parm) * yscale; maze[int (ic + x)][int (jc + y)] = '\0'; parm += 0.01; - }; + } maze[int (ic + x + 0.5)][int (jc + y + 0.5)] = '<'; /* cut out the center in a 2x2 and place the center and downexit */ maze[ic][jc + 1] = '>'; maze[ic][jc] = 'C'; - - return maze; } /* the following function connects disjoint spirals which may