From 3c49f7a9413a3f979c7c7bc1f977852b52b78229 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 10 Jan 2003 03:33:03 +0000 Subject: [PATCH] fix B15007 - boomerangs used hand-to-hand Hitting with a wielded boomerang was supposed to have a chance to break it, but the code was located in a spot that would never be reached when bashing with a missile weapon. Also, its rnl() usage would have made the bad effect--losing your weapon--be more likely to occur when you had good luck and less likely when you had bad luck. And it wasn't setting `unweapon', so you wouldn't have gotten a bashing with barehands message on the next attack after the weapon had been destroyed. --- src/uhitm.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/uhitm.c b/src/uhitm.c index f03e12aff..6f43a0504 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -578,6 +578,17 @@ int thrown; tmp = 0; else 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 */ + useup(obj); + obj = (struct obj *) 0; + hittxt = TRUE; + if (mdat != &mons[PM_SHADE]) + tmp++; + } } else { tmp = dmgval(obj, mon); /* a minimal hit doesn't exercise proficiency */ @@ -637,16 +648,7 @@ int thrown; if (jousting) valid_weapon_attack = TRUE; } #endif - if(!thrown && obj == uwep && obj->otyp == BOOMERANG && - !rnl(3)) { - pline("As you hit %s, %s breaks into splinters.", - mon_nam(mon), the(xname(obj))); - useup(obj); - obj = (struct obj *) 0; - hittxt = TRUE; - if (mdat != &mons[PM_SHADE]) - tmp++; - } else if(thrown && (is_ammo(obj) || is_missile(obj))) { + if (thrown && (is_ammo(obj) || is_missile(obj))) { if (ammo_and_launcher(obj, uwep)) { /* Elves and Samurai do extra damage using * their bows&arrows; they're highly trained. -- 2.40.0