From 6bb53178eb1126cb0651672cadfcc3fb6d5cd1ac Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 25 Jan 2003 07:33:06 +0000 Subject: [PATCH] fix B17006 - stacked boomerang handling Breaking a boomerang while bashing with it didn't work right when there was a stack of more than one involved. The message given had a grammar buglet and the remaining boomerangs became unwielded. (This issue wasn't present in 3.4.0 because the boomerang bashing code never got called there.) --- src/uhitm.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/uhitm.c b/src/uhitm.c index 3ed1961f2..3cad55a45 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)uhitm.c 3.4 2003/01/02 */ +/* SCCS Id: @(#)uhitm.c 3.4 2003/01/24 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -580,11 +580,14 @@ int thrown; tmp = rnd(2); if (!thrown && obj == uwep && obj->otyp == BOOMERANG && rnl(4) == 4-1) { - pline("As you hit %s, %s %s breaks into splinters.", - mon_nam(mon), shk_your(yourbuf, obj), xname(obj)); - uwepgone(); /* set unweapon */ + boolean more_than_1 = (obj->quan > 1L); + + pline("As you hit %s, %s%s %s breaks into splinters.", + mon_nam(mon), more_than_1 ? "one of " : "", + shk_your(yourbuf, obj), xname(obj)); + if (!more_than_1) uwepgone(); /* set unweapon */ useup(obj); - obj = (struct obj *) 0; + if (!more_than_1) obj = (struct obj *) 0; hittxt = TRUE; if (mdat != &mons[PM_SHADE]) tmp++; -- 2.40.0