From b9f66bb4c2bf489214a3775f7d6fc4c2d66b8ae2 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 27 Dec 2002 03:29:46 +0000 Subject: [PATCH] fix B15006 - breaking lances with jousting Post 3.4.0 bug: "Your a lance (weapon in hand) shatters on impact!" Use xname() instead of doname() to get "lance" instead of "a lance" here. It also wasn't giving "you start bashing with your bare/gloved hands" on the next attack after losing the weapon. --- src/uhitm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/uhitm.c b/src/uhitm.c index a152e9295..3142eb57f 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)uhitm.c 3.4 2002/12/09 */ +/* SCCS Id: @(#)uhitm.c 3.4 2002/12/26 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -925,7 +925,10 @@ int thrown; You("joust %s%s", mon_nam(mon), canseemon(mon) ? exclam(tmp) : "."); if (jousting < 0) { - Your("%s shatters on impact!", doname(obj)); + Your("%s shatters on impact!", xname(obj)); + /* (must be either primary or secondary weapon to get here) */ + u.twoweap = FALSE; /* untwoweapon() is too verbose here */ + if (obj == uwep) uwepgone(); /* set unweapon */ /* minor side-effect: broken lance won't split puddings */ useup(obj); obj = 0; @@ -1080,6 +1083,8 @@ struct obj *obj; /* weapon */ int skill_rating, joust_dieroll; if (Fumbling || Stunned) return 0; + /* sanity check; lance must be wielded in order to joust */ + if (obj != uwep && (obj != uswapwep || !u.twoweap)) return 0; /* if using two weapons, use worse of lance and two-weapon skills */ skill_rating = P_SKILL(weapon_type(obj)); /* lance skill */