diff --git a/doc/fixes34.4 b/doc/fixes34.4 index de88d0c09..cf5a22a77 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -220,6 +220,7 @@ create_object() created lizard corpses without timers and troll corpses with when a potion of acid was dropped into water and exploded, nethack would continue to use already freed memory and later might panic or crash when jumping over an already seen trap, use an() to get appropriate grammar +fix bad grammar when putting on not-yet-seen Eyes of the Overworld while blind Platform- and/or Interface-Specific Fixes diff --git a/src/do_wear.c b/src/do_wear.c index d7de101f9..9a31887c2 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)do_wear.c 3.5 2005/12/07 */ +/* SCCS Id: @(#)do_wear.c 3.5 2006/05/17 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -51,25 +51,28 @@ STATIC_DCL void FDECL(already_wearing2, (const char*, const char*)); void off_msg(otmp) -register struct obj *otmp; +struct obj *otmp; { - if(flags.verbose) + if (flags.verbose) You("were wearing %s.", doname(otmp)); } /* for items that involve no delay */ STATIC_OVL void on_msg(otmp) -register struct obj *otmp; +struct obj *otmp; { if (flags.verbose) { char how[BUFSZ]; + /* call xname() before obj_is_pname(); formatting obj's name + might set obj->dknown and that affects the pname test */ + const char *otmp_name = xname(otmp); how[0] = '\0'; if (otmp->otyp == TOWEL) Sprintf(how, " around your %s", body_part(HEAD)); You("are now wearing %s%s.", - obj_is_pname(otmp) ? the(xname(otmp)) : an(xname(otmp)), + obj_is_pname(otmp) ? the(otmp_name) : an(otmp_name), how); } }