]> granicus.if.org Git - nethack/commitdiff
wizard mode wishing bit
authorPatR <rankin@nethack.org>
Sat, 21 May 2022 22:19:48 +0000 (15:19 -0700)
committerPatR <rankin@nethack.org>
Sat, 21 May 2022 22:19:48 +0000 (15:19 -0700)
I meant to wish for a "wand of cold" and accidentally typed "wand of
ice".  Instead of being told that there's no such thing or receiving
a random wand, the spot I was standing on was changed to ice.

Only check for a terrain-change wish if an object class hasn't been
stripped from the wish text.

src/objnam.c

index 61c277d5e1b4c60657e850745d01b9cd121699d6..58f72ea78182707c7db80be6e1453455a6dd28fe 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 objnam.c        $NHDT-Date: 1652332281 2022/05/12 05:11:21 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.361 $ */
+/* NetHack 3.7 objnam.c        $NHDT-Date: 1653171584 2022/05/21 22:19:44 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.364 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2011. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -4514,7 +4514,7 @@ readobjnam(char *bp, struct obj *no_wish)
      * Disallow such topology tweaks for WIZKIT startup wishes.
      */
  wiztrap:
-    if (wizard && !g.program_state.wizkit_wishing) {
+    if (wizard && !g.program_state.wizkit_wishing && !d.oclass) {
         /* [inline code moved to separate routine to unclutter readobjnam] */
         if ((d.otmp = wizterrainwish(&d)) != 0)
             return d.otmp;