--- deliantra/server/random_maps/rogue_layout.C 2008/04/14 22:41:17 1.8 +++ deliantra/server/random_maps/rogue_layout.C 2008/04/15 03:00:24 1.9 @@ -31,12 +31,16 @@ if ((i > 0) && (layout[i - 1][j] != 0 && layout[i - 1][j] != '.')) surround_index += 1; + if ((i < Xsize - 1) && (layout[i + 1][j] != 0 && layout[i + 1][j] != '.')) surround_index += 2; + if ((j > 0) && (layout[i][j - 1] != 0 && layout[i][j - 1] != '.')) surround_index += 4; + if ((j < Ysize - 1) && (layout[i][j + 1] != 0 && layout[i][j + 1] != '.')) surround_index += 8; + return surround_index; } @@ -44,7 +48,7 @@ * first we make everything a wall, then we remove areas to make rooms */ void -roguelike_layout_gen (Maze maze, int options) +roguelike_layout_gen (Layout maze, int options) { int i, j; Room *walk; @@ -85,8 +89,8 @@ i++; } - if (i == 0) - { /* no can do! */ + if (i == 0) /* no can do! */ + { maze->clear (); maze->border (); @@ -97,7 +101,6 @@ return; } - /* erase the areas occupied by the rooms */ roguelike_make_rooms (rooms, maze, options);