From 823b770ad9fa780819967767caf058d0e3e095bd Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 25 Jun 2021 13:39:26 +0300 Subject: [PATCH] Fix thinko in the shk litter indexing --- src/shk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shk.c b/src/shk.c index 120078d10..f4075b723 100644 --- a/src/shk.c +++ b/src/shk.c @@ -3643,8 +3643,8 @@ litter_scatter(xchar *litter, int k, xchar x, xchar y, struct monst *shkp) /* otmp must be moved otherwise g.level.objects[x][y] will never become Null and while-loop won't terminate */ do { - i++; - } while (--trylimit && !(litter[i % 9] & LITTER_INSHOP)); + i = (i + 1) % 9; + } while (--trylimit && !(litter[i] & LITTER_INSHOP)); if ((litter[i] & (LITTER_OPEN | LITTER_INSHOP)) != 0) { ix = x + horiz(i); iy = y + vert(i);