]> granicus.if.org Git - nethack/commitdiff
missing altar drop messages
authorcohrs <cohrs>
Tue, 17 Dec 2002 03:36:42 +0000 (03:36 +0000)
committercohrs <cohrs>
Tue, 17 Dec 2002 03:36:42 +0000 (03:36 +0000)
Most callers of dropx did not check for altars, but should have.  Rather
than add such checks, I moved the check from drop to dropx.  I also found
several callers of dropx that could generate out-of-order messages for some
cases (not new) and fixed them. FYI - callers of dropy don't seem to want
altar checks or already do them.

doc/fixes34.1
src/apply.c
src/do.c
src/write.c

index 48fcd36ee75d5ba01fac7a15525452a720224190..4e272586a9bda480375e541d42d059fe537daed5 100644 (file)
@@ -329,6 +329,7 @@ non-moving monster are not affected by liquid
 'A' command wouldn't remove cursed item from quiver or alternate weapon slot
 'A' command behaved differently depending on menustyle when non-weapons were
        present in the quiver or alternate weapon inventory slots
+most cases of the hero dropping things need to check for dropping on an altar
 
 
 Platform- and/or Interface-Specific Fixes
index 6f27d8f55e5483b17d45c444cf49eb6b70fe0f16..4c96955e22631b404f1cb57a16a8cafc6bfa796e 100644 (file)
@@ -1768,9 +1768,9 @@ struct obj *obj;
        char buf[BUFSZ];
 
        if (Glib) {
-           dropx(obj);
            pline("%s from your %s.", Tobjnam(obj, "slip"),
                  makeplural(body_part(FINGER)));
+           dropx(obj);
            return;
        }
 
@@ -1778,9 +1778,9 @@ struct obj *obj;
                if ((obj->cursed || Fumbling) && !rn2(2)) {
                        check_unpaid(obj);
                        obj->spe--;
-                       dropx(obj);
                        pline("%s from your %s.", Tobjnam(obj, "slip"),
                              makeplural(body_part(FINGER)));
+                       dropx(obj);
                        return;
                }
                otmp = getobj(lubricables, "grease");
index d0de64dac80060f185e333e178e587c14a7f5021..e4d6fac5c88494d21a93c348a3b8a34eafce518d 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -492,10 +492,8 @@ register struct obj *obj;
                hitfloor(obj);
                return(1);
            }
-           if (IS_ALTAR(levl[u.ux][u.uy].typ)) {
-               doaltarobj(obj);        /* set bknown */
-           } else
-               if(flags.verbose) You("drop %s.", doname(obj));
+           if (!IS_ALTAR(levl[u.ux][u.uy].typ) && flags.verbose)
+               You("drop %s.", doname(obj));
        }
        dropx(obj);
        return(1);
@@ -514,7 +512,11 @@ register struct obj *obj;
         if (obj->oclass == COIN_CLASS) flags.botl = 1;
         freeinv(obj);
 #endif
-       if (!u.uswallow && ship_object(obj, u.ux, u.uy, FALSE)) return;
+       if (!u.uswallow) {
+           if (ship_object(obj, u.ux, u.uy, FALSE)) return;
+           if (IS_ALTAR(levl[u.ux][u.uy].typ))
+               doaltarobj(obj); /* set bknown */
+       }
        dropy(obj);
 }
 
index 03f804fa69e517baadee76318adbeea7563d087b..669c7f1270837d79aa9eb6507524c2dc51b1617f 100644 (file)
@@ -84,9 +84,9 @@ register struct obj *pen;
            You("need hands to be able to write!");
            return 0;
        } else if (Glib) {
-           dropx(pen);
            pline("%s from your %s.",
                  Tobjnam(pen, "slip"), makeplural(body_part(FINGER)));
+           dropx(pen);
            return 1;
        }