summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-01-10 14:49:18 -0600
committerJesse Luehrs <doy@tozt.net>2010-01-10 14:49:18 -0600
commite46a80b5fd4e3f4276fc8f10b123763717dafd97 (patch)
tree4c66e64d15bb53458b79b0552accdba1da486474 /crawl-ref/source/dungeon.cc
parent2a48502991f0b10ff34a74463cc5216a3db85b3e (diff)
downloadcrawl-ref-e46a80b5fd4e3f4276fc8f10b123763717dafd97.tar.gz
crawl-ref-e46a80b5fd4e3f4276fc8f10b123763717dafd97.zip
remove free standing doors
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 52a527361e..7baa51eb3f 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -7778,6 +7778,23 @@ static void _ruin_level()
grd(*it) = DNGN_FLOOR;
}
+ /* but remove doors if we've removed all adjacent walls */
+ for (adjacent_iterator wai(*it); wai; ++wai)
+ {
+ if (feat_is_door(grd(*wai))) {
+ bool remove = true;
+ for (adjacent_iterator dai(*wai); dai; ++dai)
+ {
+ if (feat_is_wall(grd(*dai))) {
+ remove = false;
+ }
+ }
+ if (remove) {
+ grd(*wai) = DNGN_FLOOR;
+ }
+ }
+ }
+
/* replace some ruined walls with plants/fungi/bushes */
if (one_chance_in(5)) {
mgen_data mg;