wizard mode wishing bit

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.
This commit is contained in:
PatR
2022-05-21 15:19:48 -07:00
parent f19ccde709
commit 15882c5bee

View 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;