misbehavior when tethered aklys gets stuck in web

Reported by elunna after it was noticed on Hack'EM
Closes #1152
This commit is contained in:
nhmall
2023-11-25 20:47:35 -05:00
parent 6c5b5c0688
commit b2a94c8555
2 changed files with 8 additions and 1 deletions

View File

@@ -3717,6 +3717,8 @@ bhit(
boolean in_skip = FALSE, allow_skip = FALSE;
boolean tethered_weapon = FALSE;
int skiprange_start = 0, skiprange_end = 0, skipcount = 0;
struct obj *was_returning =
(iflags.returning_missile == obj) ? obj : (struct obj *) 0;
if (weapon == KICKED_WEAPON) {
/* object starts one square in front of player */
@@ -3806,6 +3808,8 @@ bhit(
ttmp->tseen = TRUE;
newsym(x, y);
}
if (was_returning)
iflags.returning_missile = (genericptr_t) 0;
break;
}
@@ -3979,7 +3983,8 @@ bhit(
point_blank = FALSE; /* affects passing through iron bars */
}
if (weapon != ZAPPED_WAND && weapon != INVIS_BEAM && !tethered_weapon)
if ((weapon != ZAPPED_WAND && weapon != INVIS_BEAM && !tethered_weapon)
|| (was_returning && was_returning != iflags.returning_missile))
tmp_at(DISP_END, 0);
if (shopdoor)