From: cohrs Date: Tue, 2 Jul 2002 05:55:23 +0000 (+0000) Subject: dropping gold on an altar X-Git-Tag: MOVE2GIT~2688 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6ec3e35a7b0055ee9540aa1b937e80a55e6928e;p=nethack dropping gold on an altar reported that dropping gold on an altar prints no message. As a side effect, gnostic conduct was never affected, which seemed odd; dropping other known objects would still affect your gnostic conduct. While fixing this, I noticed a GOLDOBJ-related bug when dropping gold while levitating. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index adac69506..77675a15e 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -135,6 +135,7 @@ unmap "I" symbols when searching while blind and levitating monsters that are frozen or sleeping cannot be grateful for untrapping grammar of blessed-detection eating warning messages when eating 1 of N objects message for charging for items lost in a cursed magic bag wasn't always shown +dropping gold on an altar printed no message and didn't change gnostic conduct Platform- and/or Interface-Specific Fixes diff --git a/src/do.c b/src/do.c index db461f946..19cc6cb87 100644 --- a/src/do.c +++ b/src/do.c @@ -218,13 +218,13 @@ void doaltarobj(obj) /* obj is an object dropped on an altar */ register struct obj *obj; { - if (Blind || obj->oclass == GOLD_CLASS) + if (Blind) return; /* KMH, conduct */ u.uconduct.gnostic++; - if (obj->blessed || obj->cursed) { + if ((obj->blessed || obj->cursed) && obj->oclass != GOLD_CLASS) { There("is %s flash as %s %s the altar.", an(hcolor(obj->blessed ? amber : Black)), doname(obj), otense(obj, "hit")); @@ -483,7 +483,13 @@ register struct obj *obj; #endif if (!can_reach_floor()) { if(flags.verbose) You("drop %s.", doname(obj)); +#ifndef GOLDOBJ if (obj->oclass != GOLD_CLASS || obj == invent) freeinv(obj); +#else + /* Ensure update when we drop gold objects */ + if (obj->oclass == GOLD_CLASS) flags.botl = 1; + freeinv(obj); +#endif hitfloor(obj); return(1); } @@ -507,10 +513,6 @@ register struct obj *obj; #else /* Ensure update when we drop gold objects */ if (obj->oclass == GOLD_CLASS) flags.botl = 1; - /* Money is usually not in our inventory */ - /*if (obj->oclass != GOLD_CLASS || obj == invent)*/ - /* !!!! make sure we don't drop "created" gold not in inventory any more,*/ - /* or this will crash !!!! */ freeinv(obj); #endif if (!u.uswallow && ship_object(obj, u.ux, u.uy, FALSE)) return;