Audit rloc()
Most of the time, rloc() is used for teleporting monsters and it's not a big deal if they can't find somewhere to go. In a few cases, it is. I went through all the callsites and made calls to rloc() not cause impossible()s if they don't need to. Fixes a bug/suite of bugs reported by ais523.
This commit is contained in:
@@ -1017,7 +1017,7 @@ register struct attack *mattk;
|
||||
if (vis)
|
||||
Strcpy(mdef_Monnam, Monnam(mdef));
|
||||
mdef->mstrategy &= ~STRAT_WAITFORU;
|
||||
(void) rloc(mdef, FALSE);
|
||||
(void) rloc(mdef, TRUE);
|
||||
if (vis && !canspotmon(mdef) && mdef != u.usteed)
|
||||
pline("%s suddenly disappears!", mdef_Monnam);
|
||||
}
|
||||
@@ -1139,7 +1139,7 @@ register struct attack *mattk;
|
||||
pline("%s steals some gold from %s.", buf, mon_nam(mdef));
|
||||
}
|
||||
if (!tele_restrict(magr)) {
|
||||
(void) rloc(magr, FALSE);
|
||||
(void) rloc(magr, TRUE);
|
||||
if (vis && !canspotmon(magr))
|
||||
pline("%s suddenly disappears!", buf);
|
||||
}
|
||||
@@ -1202,7 +1202,7 @@ register struct attack *mattk;
|
||||
return (MM_DEF_DIED
|
||||
| (grow_up(magr, mdef) ? 0 : MM_AGR_DIED));
|
||||
if (pa->mlet == S_NYMPH && !tele_restrict(magr)) {
|
||||
(void) rloc(magr, FALSE);
|
||||
(void) rloc(magr, TRUE);
|
||||
if (vis && !canspotmon(magr))
|
||||
pline("%s suddenly disappears!", buf);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user