diff options
Diffstat (limited to 'crawl-ref/source/test')
-rw-r--r-- | crawl-ref/source/test/shoal-hut.lua | 15 |
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) |