]> granicus.if.org Git - nethack/commitdiff
Don't let monsters loot Schroedinger's box
authorPasi Kallinen <paxed@alt.org>
Sat, 28 Jan 2023 18:25:49 +0000 (20:25 +0200)
committerPasi Kallinen <paxed@alt.org>
Sat, 28 Jan 2023 18:27:36 +0000 (20:27 +0200)
src/muse.c

index 3277efef72b33cf2010247451e5f751959007af6..22a412adc78a0b9adc1a8c3c846120ce1f5bf3b1 100644 (file)
@@ -2021,6 +2021,7 @@ find_misc(struct monst* mtmp)
         }
         nomore(MUSE_BAG);
         if (Is_container(obj) && obj->otyp != BAG_OF_TRICKS && !rn2(5)
+            && !SchroedingersBox(obj)
             && !gm.m.has_misc && Has_contents(obj)
             && !obj->olocked && !obj->otrapped) {
             gm.m.misc = obj;
@@ -2062,6 +2063,8 @@ mloot_container(
     /* FIXME: handle cursed bag of holding */
     if (Is_mbag(container) && container->cursed)
         return res; /* 0 */
+    if (SchroedingersBox(container))
+        return res;
 
     switch (rn2(10)) {
     default: /* case 0, 1, 2, 3: */