fix #K965 - dropped fragile items don't break

when the drop is being caused by encumbrance or punishment triggering
a fall while going down stairs.

Also, remove a couple instances of 'if (obj==GOLD) contexl.botl=TRUE'
when dropping gold.  They were held over from the obsolete !GOLDOBJ
configuration.  Both are immediately followed by freeinv() which
calls freeinv_core() whichs starts off by setting the botl flag when
taking gold out of inventory.
This commit is contained in:
PatR
2020-05-11 17:51:25 -07:00
parent 0bc0997d00
commit 3165dd942e
4 changed files with 6 additions and 9 deletions

View File

@@ -980,12 +980,13 @@ litter()
for (otmp = g.invent; otmp; otmp = nextobj) {
nextobj = otmp->nobj;
if ((otmp != uball) && (rnd(capacity) <= (int) otmp->owt)) {
if (otmp != uball && rnd(capacity) <= (int) otmp->owt) {
if (canletgo(otmp, "")) {
You("drop %s and %s %s down the stairs with you.",
yname(otmp), (otmp->quan == 1L) ? "it" : "they",
otense(otmp, "fall"));
dropx(otmp);
freeinv(otmp);
hitfloor(otmp, FALSE);
encumber_msg(); /* drop[xyz]() probably ought to to this... */
}
}

View File

@@ -647,9 +647,6 @@ register struct obj *obj;
ELevitation = W_ART; /* other than W_ARTI */
if (flags.verbose)
You("drop %s.", doname(obj));
/* Ensure update when we drop gold objects */
if (obj->oclass == COIN_CLASS)
g.context.botl = 1;
freeinv(obj);
hitfloor(obj, TRUE);
if (levhack)
@@ -670,9 +667,6 @@ void
dropx(obj)
register struct obj *obj;
{
/* Ensure update when we drop gold objects */
if (obj->oclass == COIN_CLASS)
g.context.botl = 1;
freeinv(obj);
if (!u.uswallow) {
if (ship_object(obj, u.ux, u.uy, FALSE))

View File

@@ -440,7 +440,7 @@ boolean verbose;
}
/* Object hits floor at hero's feet.
Called from drop(), throwit(), hold_another_object(). */
Called from drop(), throwit(), hold_another_object(), litter(). */
void
hitfloor(obj, verbosely)
struct obj *obj;