}
/* if discernable and a threat, stop fiddling while Rome burns */
if (g.occupation)
- (void) dochugw(mtmp, TRUE);
+ (void) dochugw(mtmp, FALSE);
/* TODO: unify with teleport appears msg */
}
&& fightm(mtmp))
continue; /* mon might have died */
}
- if (dochugw(mtmp, FALSE)) /* otherwise just move the monster */
+ if (dochugw(mtmp, TRUE)) /* otherwise just move the monster */
continue;
}
int
dochugw(
register struct monst *mtmp,
- boolean dontchug) /* True: monster was just created, or maybe it has
- * teleported; perform stop-what-you're-doing-if-close-
- * enough-to-be-a-threat check but don't move mtmp */
+ boolean chug) /* True: monster is moving;
+ * False: monster was just created or has teleported
+ * so perform stop-what-you're-doing-if-close-enough-
+ * to-be-a-threat check but don't move mtmp */
{
- int x = mtmp->mx, y = mtmp->my;
- boolean already_saw_mon = ((dontchug || !g.occupation) ? 0
- : canspotmon(mtmp));
- int rd = dontchug ? 0 : dochug(mtmp);
+ int x = mtmp->mx, y = mtmp->my; /* 'mtmp's location before dochug() */
+ /* skip canspotmon() if occupation is Null */
+ boolean already_saw_mon = (chug && g.occupation) ? canspotmon(mtmp) : 0;
+ int rd = chug ? dochug(mtmp) : 0;
/*
* A similar check is in monster_nearby() in hack.c.
Monnam(mtmp),
next2u(x, y) ? " next to you"
: (distu(x, y) <= (BOLT_LIM * BOLT_LIM)) ? " close by"
- : (distu(x, y) < distu(oldx, oldy)) ? " closer to you"
- : " further away");
+ : (distu(x, y) < distu(oldx, oldy)) ? " closer to you"
+ : " further away");
} else {
pline("%s %s%s%s!",
appearmsg ? Amonnam(mtmp) : Monnam(mtmp),
appearmsg ? "suddenly " : "",
!Blind ? "appears" : "arrives",
next2u(x, y) ? " next to you"
- : (distu(x, y) <= (BOLT_LIM * BOLT_LIM)) ? " close by" : "");
+ : (distu(x, y) <= (BOLT_LIM * BOLT_LIM)) ? " close by"
+ : "");
}
}
if (resident_shk && !inhishop(mtmp))
make_angry_shk(mtmp, oldx, oldy);
+ /* if hero is busy, maybe stop occupation */
+ if (g.occupation)
+ (void) dochugw(mtmp, FALSE);
+
/* trapped monster teleported away */
if (mtmp->mtrapped && !mtmp->wormno)
(void) mintrap(mtmp, NO_TRAP_FLAGS);