waking waiting monsters after non-damaging attacks

- From a bug report, there are ways to, for example, steal items
from Medusa without waking her, by clever use of Conflict.
Avoid this by removing STRAT_WAITFORU when such an attack succeeds
- it was theoretically possible to use a similar approach to steal from a
STRAT_WAITFORU monster without it noticing while polymorphed and very fast,
so bulletproof this case as well.  Simpler because failed attacks wake too.
This commit is contained in:
cohrs
2002-04-15 07:00:00 +00:00
parent 86f961ba3f
commit d3078778eb
3 changed files with 17 additions and 0 deletions

View File

@@ -1464,6 +1464,7 @@ register struct attack *mattk;
break;
}
mdef->mstrategy &= ~STRAT_WAITFORU; /* in case player is very fast */
if((mdef->mhp -= tmp) < 1) {
if (mdef->mtame && !cansee(mdef->mx,mdef->my)) {
You_feel("embarrassed for a moment.");