From c764bd5e41e8206bafcc6e202f341059ea599116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Cupia=C5=82?= Date: Mon, 23 Feb 2026 18:01:07 +0100 Subject: [PATCH] patch boulder trap --- src/trap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/trap.c b/src/trap.c index b6db81148..f390e19c2 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1858,6 +1858,14 @@ int style; bhitpos.x += dx; bhitpos.y += dy; + /* check if the obj is not out of bounds */ + if (!isok(bhitpos.x, bhitpos.y)) { + bhitpos.x -= dx; + bhitpos.y -= dy; + x2 = bhitpos.x, y2 = bhitpos.y; /* object stops here */ + break; + } + if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != 0) { if (otyp == BOULDER && throws_rocks(mtmp->data)) { if (rn2(3)) {