]> granicus.if.org Git - nethack/commitdiff
Fix infinite throne looting when confused
authorPasi Kallinen <paxed@alt.org>
Tue, 24 Nov 2015 09:16:03 +0000 (11:16 +0200)
committerPasi Kallinen <paxed@alt.org>
Tue, 24 Nov 2015 09:16:07 +0000 (11:16 +0200)
This could be used to generate monsters ad infinitum.

src/pickup.c

index 1d621b48c722bde8f9c1501c6052561d4ec10b41..0fa4e65cccdf0ca39baa18487a0784021d3747c8 100644 (file)
@@ -1818,10 +1818,13 @@ reverse_loot()
                 boxdummy = zeroobj, boxdummy.otyp = SPE_WIZARD_LOCK;
                 (void) boxlock(coffers, &boxdummy);
             }
-        } else if ((mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) {
+        } else if (levl[x][y].looted != T_LOOTED &&
+                   (mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) {
             freeinv(goldob);
             add_to_minv(mon, goldob);
             pline("The exchequer accepts your contribution.");
+            if (!rn2(10))
+                levl[x][y].looted = T_LOOTED;
         } else {
             You("drop %s.", doname(goldob));
             dropx(goldob);