]> granicus.if.org Git - nethack/commitdiff
Fix monster hiding under consumed candle
authorPasi Kallinen <paxed@alt.org>
Tue, 26 Jul 2022 19:53:57 +0000 (22:53 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 26 Jul 2022 19:53:57 +0000 (22:53 +0300)
src/timeout.c

index 82df30c6282d80fd387baf8eb2d6b2f81df52fc5..096e20b27a97dbee59c3098025de5e4f049725b9 100644 (file)
@@ -1240,12 +1240,18 @@ burn_object(anything *arg, long timeout)
                 obj->spe = 0; /* no more candles */
                 obj->owt = weight(obj);
             } else if (Is_candle(obj) || obj->otyp == POT_OIL) {
+                struct monst *mtmp = NULL;
+
+                if (obj->where == OBJ_FLOOR)
+                    mtmp = m_at(obj->ox, obj->oy);
                 /* get rid of candles and burning oil potions;
                    we know this object isn't carried by hero,
                    nor is it migrating */
                 obj_extract_self(obj);
                 obfree(obj, (struct obj *) 0);
                 obj = (struct obj *) 0;
+                if (mtmp)
+                    maybe_unhide_at(mtmp->mx, mtmp->my);
             }
 
         } else {