From 2ebbd13f79190586fdcc3f112139d314490b3e39 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 28 May 2024 18:31:12 +0300 Subject: [PATCH] Fix boulder over a hole or a pit dug by a monster When a monster digs down and creates a pit or a hole, drop the boulder at the location into it. --- src/muse.c | 2 ++ src/trap.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/muse.c b/src/muse.c index d95b0c2e8..e4b408f3f 100644 --- a/src/muse.c +++ b/src/muse.c @@ -899,6 +899,7 @@ use_defensive(struct monst *mtmp) pline("%s has made a pit in the %s.", Monnam(mtmp), surface(mtmp->mx, mtmp->my)); } + fill_pit(mtmp->mx, mtmp->my); return (mintrap(mtmp, FORCEBUNGLE) == Trap_Killed_Mon) ? 1 : 2; } t = maketrap(mtmp->mx, mtmp->my, HOLE); @@ -915,6 +916,7 @@ use_defensive(struct monst *mtmp) You_hear("%s crash through the %s.", something, surface(mtmp->mx, mtmp->my)); } + fill_pit(mtmp->mx, mtmp->my); /* we made sure that there is a level for mtmp to go to */ migrate_to_level(mtmp, ledger_no(&u.uz) + 1, MIGR_RANDOM, (coord *) 0); diff --git a/src/trap.c b/src/trap.c index b73db008c..f0c7e63a4 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3819,13 +3819,14 @@ float_up(void) return; } +/* a boulder fills a pit or a hole at x,y */ void fill_pit(coordxy x, coordxy y) { struct obj *otmp; struct trap *t; - if ((t = t_at(x, y)) != 0 && is_pit(t->ttyp) + if ((t = t_at(x, y)) != 0 && (is_pit(t->ttyp) || is_hole(t->ttyp)) && (otmp = sobj_at(BOULDER, x, y)) != 0) { obj_extract_self(otmp); (void) flooreffects(otmp, x, y, "settle");