From fb2da9f1fff0583e6e417618d9eeace5ffe3a1e7 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 31 Mar 2007 07:51:51 +0000 Subject: Marooned floating vault fix. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.2@1138 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/dungeon.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 52a0400fc9..524ab8c86d 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -5724,23 +5724,28 @@ static void dig_vault_loose( dig_away_from(place, targets[i]); } +static bool grid_needs_exit(int x, int y) +{ + return (!grid_is_solid(x, y) || grd[x][y] == DNGN_CLOSED_DOOR); +} + static void pick_float_exits(vault_placement &place, std::vector &targets) { std::vector possible_exits; for (int y = place.y; y < place.y + place.height; ++y) { - if (!grid_is_solid(place.x, y)) + if (grid_needs_exit(place.x, y)) possible_exits.push_back( coord_def(place.x, y) ); - if (!grid_is_solid(place.x + place.width - 1, y)) + if (grid_needs_exit(place.x + place.width - 1, y)) possible_exits.push_back( coord_def(place.x + place.width - 1, y) ); } for (int x = place.x + 1; x < place.x + place.width - 1; ++x) { - if (!grid_is_solid(x, place.y)) + if (grid_needs_exit(x, place.y)) possible_exits.push_back( coord_def(x, place.y) ); - if (!grid_is_solid(x, place.y + place.height - 1)) + if (grid_needs_exit(x, place.y + place.height - 1)) possible_exits.push_back( coord_def(x, place.y + place.height - 1) ); } -- cgit v1.2.3-54-g00ecf