dropping gold on an altar

<Someone> 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.
This commit is contained in:
cohrs
2002-07-02 05:55:23 +00:00
parent 2c277e15d1
commit c6ec3e35a7
2 changed files with 9 additions and 6 deletions
+1
View File
@@ -135,6 +135,7 @@ unmap "I" symbols when searching while blind and levitating
monsters that are frozen or sleeping cannot be grateful for untrapping monsters that are frozen or sleeping cannot be grateful for untrapping
grammar of blessed-detection eating warning messages when eating 1 of N objects 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 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 Platform- and/or Interface-Specific Fixes
+8 -6
View File
@@ -218,13 +218,13 @@ void
doaltarobj(obj) /* obj is an object dropped on an altar */ doaltarobj(obj) /* obj is an object dropped on an altar */
register struct obj *obj; register struct obj *obj;
{ {
if (Blind || obj->oclass == GOLD_CLASS) if (Blind)
return; return;
/* KMH, conduct */ /* KMH, conduct */
u.uconduct.gnostic++; 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.", There("is %s flash as %s %s the altar.",
an(hcolor(obj->blessed ? amber : Black)), an(hcolor(obj->blessed ? amber : Black)),
doname(obj), otense(obj, "hit")); doname(obj), otense(obj, "hit"));
@@ -483,7 +483,13 @@ register struct obj *obj;
#endif #endif
if (!can_reach_floor()) { if (!can_reach_floor()) {
if(flags.verbose) You("drop %s.", doname(obj)); if(flags.verbose) You("drop %s.", doname(obj));
#ifndef GOLDOBJ
if (obj->oclass != GOLD_CLASS || obj == invent) freeinv(obj); 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); hitfloor(obj);
return(1); return(1);
} }
@@ -507,10 +513,6 @@ register struct obj *obj;
#else #else
/* Ensure update when we drop gold objects */ /* Ensure update when we drop gold objects */
if (obj->oclass == GOLD_CLASS) flags.botl = 1; 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); freeinv(obj);
#endif #endif
if (!u.uswallow && ship_object(obj, u.ux, u.uy, FALSE)) return; if (!u.uswallow && ship_object(obj, u.ux, u.uy, FALSE)) return;