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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user