--- deliantra/server/random_maps/treasure.C 2010/06/26 22:10:18 1.54 +++ deliantra/server/random_maps/treasure.C 2010/07/02 03:40:14 1.56 @@ -499,21 +499,16 @@ static object * find_monster_in_room (maptile *map, int x, int y, random_map_params *RP) { - Layout layout2 (RP); + Layout layout2 (map->width, map->height); - layout2->clear (); - - /* allocate and copy the layout, converting C to 0. */ - for (int i = 0; i < layout2->w; i++) - for (int j = 0; j < layout2->h; j++) - if (wall_blocked (map, i, j)) - layout2[i][j] = '#'; + // find walls + for (int i = 0; i < layout2.w; i++) + for (int j = 0; j < layout2.h; j++) + layout2[i][j] = wall_blocked (map, i, j) ? '#' : 0; theMonsterToFind = 0; theMonsterToFind = find_monster_in_room_recursive (layout2, map, x, y, RP); - layout2.free (); - return theMonsterToFind; } @@ -611,7 +606,7 @@ lx = x + freearr_x[i]; ly = y + freearr_y[i]; - sindex = surround_flag3 (map, lx, ly, RP); + sindex = surround_flag3 (map, lx, ly); /* if it's blocked on 3 sides, it's enclosed */ if (sindex == 7 || sindex == 11 || sindex == 13 || sindex == 14) { @@ -629,7 +624,7 @@ lx = x + freearr_x[i]; ly = y + freearr_y[i]; - sindex = surround_flag3 (map, lx, ly, RP); + sindex = surround_flag3 (map, lx, ly); /* if it's blocked on 3 sides, it's enclosed */ if (sindex == 3 || sindex == 5 || sindex == 9 || sindex == 6 || sindex == 10 || sindex == 12) { @@ -646,7 +641,7 @@ lx = x + freearr_x[i]; ly = y + freearr_y[i]; - sindex = surround_flag3 (map, lx, ly, RP); + sindex = surround_flag3 (map, lx, ly); /* if it's blocked on 3 sides, it's enclosed */ if (sindex) { @@ -793,7 +788,7 @@ object **doorlist = (object **)calloc (sizeof (int), 1024); - LayoutData layout2 (RP->Xsize, RP->Ysize); + Layout layout2 (RP->Xsize, RP->Ysize); layout2.clear (); /* allocate and copy the layout, converting C to 0. */