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:
Sean Hunt
2015-05-24 21:40:33 +09:00
committed by nhmall
parent 80703597c0
commit a67759cbc3
12 changed files with 29 additions and 29 deletions

View File

@@ -116,7 +116,7 @@ register struct monst *mtmp;
(Levitation || Flying) ? "beneath" : "between", whose, what);
if (!ygold || !rn2(5)) {
if (!tele_restrict(mtmp))
(void) rloc(mtmp, FALSE);
(void) rloc(mtmp, TRUE);
monflee(mtmp, 0, FALSE, FALSE);
}
} else if (ygold) {
@@ -131,7 +131,7 @@ register struct monst *mtmp;
add_to_minv(mtmp, ygold);
Your("purse feels lighter.");
if (!tele_restrict(mtmp))
(void) rloc(mtmp, FALSE);
(void) rloc(mtmp, TRUE);
monflee(mtmp, 0, FALSE, FALSE);
context.botl = 1;
}
@@ -164,7 +164,7 @@ stealarm(VOID_ARGS)
so we don't set mavenge bit here. */
monflee(mtmp, 0, FALSE, FALSE);
if (!tele_restrict(mtmp))
(void) rloc(mtmp, FALSE);
(void) rloc(mtmp, TRUE);
break;
}
}
@@ -554,7 +554,7 @@ struct monst *mtmp;
(void) mpickobj(mtmp, otmp); /* may merge and free otmp */
pline("%s stole %s!", Monnam(mtmp), doname(otmp));
if (can_teleport(mtmp->data) && !tele_restrict(mtmp))
(void) rloc(mtmp, FALSE);
(void) rloc(mtmp, TRUE);
}
}