diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-31 07:51:51 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-31 07:51:51 +0000 |
commit | fb2da9f1fff0583e6e417618d9eeace5ffe3a1e7 (patch) | |
tree | 1bf5cc4e1e427549d401b3b3cad74c95a81fe189 | |
parent | 599dffd524dbfee7b7d9383c17b3963d418c9c13 (diff) | |
download | crawl-ref-fb2da9f1fff0583e6e417618d9eeace5ffe3a1e7.tar.gz crawl-ref-fb2da9f1fff0583e6e417618d9eeace5ffe3a1e7.zip |
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
-rw-r--r-- | crawl-ref/source/dungeon.cc | 13 |
1 files 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<coord_def> &targets) { std::vector<coord_def> 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) ); } |