From 6fcb3fc0c79b89fba068878243321fca8db95165 Mon Sep 17 00:00:00 2001 From: Patric Mueller Date: Sun, 10 May 2020 14:23:34 +0200 Subject: [PATCH] Only generate shop items on solid floor squares This commit addresses one issue raised in #338 that shop items were generated on lava squares. --- doc/fixes37.0 | 1 + src/shknam.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 72c20003f..1ffedec85 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -240,6 +240,7 @@ X11: was still initializing map to 'stone' instead of 'unexplored' after they became separate glyphs X11: for text map without color, add support for black&white ice; draw it in inverse video to distinguish from ordinary floor +only generate shop items on solid floor squares Platform- and/or Interface-Specific Fixes diff --git a/src/shknam.c b/src/shknam.c index 823570d46..7460eb8ba 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -688,6 +688,12 @@ int rmno, sh, sx,sy; || (sy == sroom->ly && g.doors[sh].y == sy - 1) || (sy == sroom->hy && g.doors[sh].y == sy + 1)) return FALSE; + + /* only generate items on solid floor squares */ + if (!IS_ROOM(levl[sx][sy].typ)) { + return FALSE; + } + return TRUE; }