From 9b9d9d1a1353717c878d85858de374cea8158590 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 May 2024 11:15:31 +0300 Subject: [PATCH] Fix getloc filter looking outside the map --- src/getpos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/getpos.c b/src/getpos.c index 417073a45..c6c9aa78b 100644 --- a/src/getpos.c +++ b/src/getpos.c @@ -396,7 +396,7 @@ gloc_filter_init(void) /* special case: if we're in a doorway, try to figure out which direction we're moving, and use that side of the doorway */ if (IS_DOOR(levl[u.ux][u.uy].typ)) { - if (u.dx || u.dy) { + if ((u.dx || u.dy) && isok(u.ux + u.dx, u.uy + u.dy)) { gloc_filter_floodfill(u.ux + u.dx, u.uy + u.dy); } else { /* TODO: maybe add both sides of the doorway? */