From 34d0e956eda0a94d11927769e77a1313d321e47b Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 13 Oct 2025 23:02:56 -0700 Subject: [PATCH] fix issue #1453 - throwing crackable object upward Issue reported by NullCGT: throwing a crackable item against the ceiling would cause it to vanish if it became [more] cracked but not yet fully shattered. Fixes #1453 --- doc/fixes3-7-0.txt | 2 ++ src/dothrow.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 15447eac8..901a756d4 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2133,6 +2133,8 @@ mounted hero was able to deliver joust hits when trapped timer sanity check for melting ice gave false complaint about non-ice for frozen moat under open drawbridge mhitm_ad_phys() was not applying Half_physical_damage when hero was target +throwing crystal plate mail or helm of brilliance up against the ceiling could + result in the item being cracked and then vanishing Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository diff --git a/src/dothrow.c b/src/dothrow.c index df019f6e4..a7d4ffd68 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1268,7 +1268,14 @@ toss_up(struct obj *obj, boolean hitsroof) if (breaktest(obj)) { pline("%s hits the %s.", Doname2(obj), ceiling(u.ux, u.uy)); breakmsg(obj, !Blind); - return breakobj(obj, u.ux, u.uy, TRUE, TRUE) ? FALSE : TRUE; + /* crackable armor will return True for breaktest() but will + usually return False for breakobj() */ + if (!breakobj(obj, u.ux, u.uy, TRUE, TRUE)) { + hitfloor(obj, FALSE); + gt.thrownobj = 0; + return TRUE; + } + return FALSE; } action = "hits"; } else {