From ed202000f10fbeff9d921345c7fb9d870972fab5 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 20 Jun 2006 02:31:37 +0000 Subject: [PATCH] #tip horn of plenty (trunk only) Bug in #tip handling for horn of plenty. Emptying one while levitating would trigger an "obj not free" panic by flooreffects() due to following hitfloor() with redundant/inappropriate dropy(). --- src/mkobj.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/mkobj.c b/src/mkobj.c index 0df94c503..be3a68b55 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1815,14 +1815,16 @@ boolean tipping; /* caller emptying entire contents; affects shop handling */ (const char *)0); } else { /* assumes this is taking place at hero's location */ - if (!can_reach_floor(TRUE)) - hitfloor(obj); - else if (IS_ALTAR(levl[u.ux][u.uy].typ)) - doaltarobj(obj); - else - pline("%s %s to the %s.", Doname2(obj), - otense(obj, "drop"), surface(u.ux, u.uy)); - dropy(obj); + if (!can_reach_floor(TRUE)) { + hitfloor(obj); /* does altar check, message, drop */ + } else { + if (IS_ALTAR(levl[u.ux][u.uy].typ)) + doaltarobj(obj); /* does its own drop message */ + else + pline("%s %s to the %s.", Doname2(obj), + otense(obj, "drop"), surface(u.ux, u.uy)); + dropy(obj); + } } if (horn->dknown) makeknown(HORN_OF_PLENTY); } -- 2.40.0