boolean suppress_impossible;
{
register int x, y, trycount;
- stairway *stway;
if (mtmp == u.usteed) {
tele();
}
if (mtmp->iswiz && mtmp->mx) { /* Wizard, not just arriving */
+ stairway *stway;
+
if (!In_W_tower(u.ux, u.uy, &u.uz)) {
stway = stairway_find_forwiz(FALSE, TRUE);
- x = stway->sx;
- y = stway->sy;
} else if (!stairway_find_forwiz(TRUE, FALSE)) { /* bottom level of tower */
stway = stairway_find_forwiz(TRUE, TRUE);
- x = stway->sx;
- y = stway->sy;
} else {
stway = stairway_find_forwiz(TRUE, FALSE);
- x = stway->sx;
- y = stway->sy;
}
+
+ x = stway ? stway->sx : 0;
+ y = stway ? stway->sy : 0;
+
/* if the wiz teleports away to heal, try the up staircase,
to block the player's escaping before he's healed
(deliberately use `goodpos' rather than `rloc_pos_ok' here) */