]> granicus.if.org Git - nethack/commitdiff
dropping gold on an altar
authorcohrs <cohrs>
Tue, 2 Jul 2002 05:55:23 +0000 (05:55 +0000)
committercohrs <cohrs>
Tue, 2 Jul 2002 05:55:23 +0000 (05:55 +0000)
<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.

doc/fixes34.1
src/do.c

index adac69506abb5c14036e2550ebce9e11b5c2e637..77675a15e6ac583faecc140cb75c57dc8e8dfc61 100644 (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
 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
index db461f9462f577d92578ee2572edaaf24240d8a5..19cc6cb872bc90d3f0c19fd33659883023f6029c 100644 (file)
--- 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;