Fix migrating monster throwing a potion

When a monster did something trying to get out of a boulder fort,
it usually meant teleporting or going down stairs or a hole.
The code didn't check for the action return value, and resulted
in a migrating monster being able to throw a potion at hero.
This commit is contained in:
Pasi Kallinen
2022-08-28 18:29:09 +03:00
parent b4c45a4b8e
commit 1acd8fd549

View File

@@ -1403,8 +1403,8 @@ m_move(register struct monst* mtmp, register int after)
cnt = mfndpos(mtmp, poss, info, flag);
if (cnt == 0) {
if (find_defensive(mtmp, TRUE))
(void) use_defensive(mtmp);
if (find_defensive(mtmp, TRUE) && use_defensive(mtmp))
return MMOVE_DONE;
return MMOVE_NOMOVES;
}
chcnt = 0;