Sting's anti-orc warning

From the newsgroup:  creating Sting via naming didn't produce
intrinsic warning (orc detection) if it was already wielded at the
time.  (Un- and re-wielding it sufficed as a workaround.)
This commit is contained in:
nethack.rankin
2002-06-25 08:27:31 +00:00
parent 174dbea372
commit fbeccb7257
2 changed files with 8 additions and 2 deletions

View File

@@ -122,6 +122,7 @@ specifying -D (or -X) to enter explore mode while restarting from a save
fix crash when using lookat on an known invisible monster with monster syms set fix crash when using lookat on an known invisible monster with monster syms set
prevent getting stuck in infinite loop when using wizard mode #levelchange prevent getting stuck in infinite loop when using wizard mode #levelchange
command to reduce level while having level-drain resistance command to reduce level while having level-drain resistance
naming an already wielded elven dagger "Sting" activates warning against orcs
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)do_name.c 3.4 2002/01/17 */ /* SCCS Id: @(#)do_name.c 3.4 2002/06/24 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -421,7 +421,12 @@ const char *name;
(genericptr_t)obj->oextra, lth, name); (genericptr_t)obj->oextra, lth, name);
} }
if (lth) artifact_exists(obj, name, TRUE); if (lth) artifact_exists(obj, name, TRUE);
if (obj->oartifact && obj == uswapwep) untwoweapon(); if (obj->oartifact) {
/* can't dual-wield with artifact as secondary weapon */
if (obj == uswapwep) untwoweapon();
/* activate warning if you've just named your weapon "Sting" */
if (obj == uwep) set_artifact_intrinsic(obj, TRUE, W_WEP);
}
if (carried(obj)) update_inventory(); if (carried(obj)) update_inventory();
return obj; return obj;
} }