summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/test
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2010-01-05 03:27:17 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2010-01-05 03:28:43 +0530
commitd4ad9bb7b61db9867490f8ad57ccfac681d58de4 (patch)
treeafc0f1a7866013fa8625208d2d4a22604ff93dd0 /crawl-ref/source/test
parented85466e0202b396bb8d5469d2babd2a24664afc (diff)
downloadcrawl-ref-d4ad9bb7b61db9867490f8ad57ccfac681d58de4.tar.gz
crawl-ref-d4ad9bb7b61db9867490f8ad57ccfac681d58de4.zip
Fix Shoals:$ sometimes producing huts with entrances facing each other, so that both huts are isolated from the rest of the level.
Diffstat (limited to 'crawl-ref/source/test')
-rw-r--r--crawl-ref/source/test/shoal-hut.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/crawl-ref/source/test/shoal-hut.lua b/crawl-ref/source/test/shoal-hut.lua
index 392a57e42d..208d590a84 100644
--- a/crawl-ref/source/test/shoal-hut.lua
+++ b/crawl-ref/source/test/shoal-hut.lua
@@ -37,15 +37,16 @@ local function shoal_hut_doors()
return doors
end
--- The hut door is blocked if there is no adjacent square that is not solid
--- or in a vault.
+-- The hut door is blocked if we cannot move from the door to a non-vault
+-- square without crossing solid terrain.
local function hut_door_blocked(door)
- for p in iter.adjacent_iterator_to(door) do
- if not feat.is_solid(dgn.grid(p.x, p.y)) then
- return false
- end
+ local function good_square(p)
+ return not dgn.in_vault(p.x, p.y)
+ end
+ local function passable_square(p)
+ return not feat.is_solid(dgn.grid(p.x, p.y))
end
- return true
+ return not dgn.find_adjacent_point(door, good_square, passable_square)
end
local function verify_stair_connected(p)