Fix knockback impossible
When monster attacked another monster, and the retaliation attack knocked back the attacking monster, the variables holding the attacking monster coordinates were out of sync and caused "no monster to remove" warning. Propagate back the knockback hit, so the current monster cannot do anything further.
This commit is contained in:
@@ -1012,7 +1012,7 @@ mdamagem(struct monst *magr, struct monst *mdef,
|
||||
|
||||
if (mhitm_knockback(magr, mdef, mattk, &mhm.hitflags,
|
||||
(MON_WEP(magr) != 0))
|
||||
&& ((mhm.hitflags & M_ATTK_DEF_DIED) != 0
|
||||
&& ((mhm.hitflags & (M_ATTK_DEF_DIED|M_ATTK_HIT)) != 0
|
||||
|| (mdef->mstate & (MON_DETACH|MON_MIGRATING|MON_LIMBO)) != 0))
|
||||
return mhm.hitflags;
|
||||
|
||||
|
||||
@@ -5027,12 +5027,15 @@ mhitm_knockback(
|
||||
dismount_steed(DISMOUNT_KNOCKED);
|
||||
} else {
|
||||
hurtle(dx, dy, knockdistance, FALSE);
|
||||
*hitflags |= M_ATTK_HIT;
|
||||
}
|
||||
set_apparxy(magr); /* update magr's idea of where you are */
|
||||
if (!Stunned && !rn2(4))
|
||||
make_stunned((long) (knockdistance + 1), TRUE); /* 2 or 3 */
|
||||
} else {
|
||||
mhurtle(mdef, dx, dy, knockdistance);
|
||||
if (!u_agr)
|
||||
*hitflags |= M_ATTK_HIT;
|
||||
if (DEADMONSTER(mdef)) {
|
||||
if (!was_u)
|
||||
*hitflags |= M_ATTK_DEF_DIED;
|
||||
|
||||
Reference in New Issue
Block a user