From: cohrs Date: Tue, 17 Dec 2002 03:36:42 +0000 (+0000) Subject: missing altar drop messages X-Git-Tag: MOVE2GIT~2299 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bcf47b76631d81c290780345cb58e6df90957cc7;p=nethack missing altar drop messages 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. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 48fcd36ee..4e272586a 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/apply.c b/src/apply.c index 6f27d8f55..4c96955e2 100644 --- a/src/apply.c +++ b/src/apply.c @@ -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"); diff --git a/src/do.c b/src/do.c index d0de64dac..e4d6fac5c 100644 --- 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); } diff --git a/src/write.c b/src/write.c index 03f804fa6..669c7f127 100644 --- a/src/write.c +++ b/src/write.c @@ -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; }