Fix: SE073 Problem: If Stormbringer is wielded as a secondary weapon and overrides your confirmation, then you get miss messages from your primary weapon even though you never attempted to hit with it in the first place. Compatible with: Slash'EM 0.0.6E1F1 Author: J. Ali Harlow, ali@avrc.city.ac.uk Date: 11 May 2000 diff -Narcd ../slashem-0.0.6E1F1/src/uhitm.c ./src/uhitm.c *** ../slashem-0.0.6E1F1/src/uhitm.c Wed Apr 26 18:49:33 2000 --- ./src/uhitm.c Thu May 11 19:35:53 2000 *************** *** 4,10 **** #include "hack.h" ! STATIC_DCL boolean FDECL(known_hitum, (struct monst *,int *,struct attack *)); STATIC_DCL void FDECL(steal_it, (struct monst *, struct attack *)); STATIC_DCL boolean FDECL(hitum, (struct monst *,int,int,struct attack *)); STATIC_DCL boolean FDECL(hmon_hitmon, (struct monst *,struct obj *,int)); --- 4,10 ---- #include "hack.h" ! STATIC_DCL boolean FDECL(known_hitum, (struct monst *,int,int *,struct attack *)); STATIC_DCL void FDECL(steal_it, (struct monst *, struct attack *)); STATIC_DCL boolean FDECL(hitum, (struct monst *,int,int,struct attack *)); STATIC_DCL boolean FDECL(hmon_hitmon, (struct monst *,struct obj *,int)); *************** *** 448,455 **** } STATIC_OVL boolean ! known_hitum(mon, mhit, uattk) /* returns TRUE if monster still lives */ register struct monst *mon; register int *mhit; struct attack *uattk; { --- 448,456 ---- } STATIC_OVL boolean ! known_hitum(mon, mattack, mhit, uattk) /* returns TRUE if monster still lives */ register struct monst *mon; + int mattack; /* Which weapons you attacked with -ALI */ register int *mhit; struct attack *uattk; { *************** *** 466,473 **** } if(!*mhit) { ! missum(mon, tohit(UWEP_ROLL), dice(UWEP_ROLL), uattk); ! if (u.twoweap) missum(mon, tohit(USWAPWEP_ROLL), dice(USWAPWEP_ROLL), uattk); } else { int oldhp = mon->mhp; --- 467,475 ---- } if(!*mhit) { ! if (mattack & HIT_UWEP) ! missum(mon, tohit(UWEP_ROLL), dice(UWEP_ROLL), uattk); ! if (mattack & HIT_USWAPWEP) missum(mon, tohit(USWAPWEP_ROLL), dice(USWAPWEP_ROLL), uattk); } else { int oldhp = mon->mhp; *************** *** 481,488 **** dieroll = dice(UWEP_ROLL); malive = hmon(mon, uwep, 0); ! } else missum(mon, tohit(UWEP_ROLL), dice(UWEP_ROLL), uattk); ! if (u.twoweap && malive) { /* KMH, ethics */ if (*mhit & HIT_USWAPWEP) { if (uswapwep) u.uconduct.weaphit++; --- 483,491 ---- dieroll = dice(UWEP_ROLL); malive = hmon(mon, uwep, 0); ! } else if (mattack & HIT_UWEP) ! missum(mon, tohit(UWEP_ROLL), dice(UWEP_ROLL), uattk); ! if ((mattack & HIT_USWAPWEP) && malive) { /* KMH, ethics */ if (*mhit & HIT_USWAPWEP) { if (uswapwep) u.uconduct.weaphit++; *************** *** 559,564 **** --- 562,568 ---- struct attack *uattk; { boolean malive; + int mattack = mhit; int tmp1 = tmp, tmp2 = tmp; if (mhit & HIT_UWEP) *************** *** 590,596 **** #endif } ! malive = known_hitum(mon, &mhit, uattk); (void) passive(mon, mhit, malive, AT_WEAP); /* berserk lycanthropes calm down after the enemy is dead */ if (!malive) repeat_hit = 0; --- 594,600 ---- #endif } ! malive = known_hitum(mon, mattack, &mhit, uattk); (void) passive(mon, mhit, malive, AT_WEAP); /* berserk lycanthropes calm down after the enemy is dead */ if (!malive) repeat_hit = 0; *************** *** 2336,2342 **** /* KMH -- Don't accumulate to-hit bonuses */ if (uwep) tmp -= hittmp; /* Enemy dead, before any special abilities used */ ! if (!known_hitum(mon,&dhit,mattk)) { sum[i] = 2; break; } else sum[i] = 1; --- 2340,2346 ---- /* KMH -- Don't accumulate to-hit bonuses */ if (uwep) tmp -= hittmp; /* Enemy dead, before any special abilities used */ ! if (!known_hitum(mon,HIT_UWEP,&dhit,mattk)) { sum[i] = 2; break; } else sum[i] = 1;