Add 'mdistu' macro
Short for distu(mtmp->mx, mtmp->my) (i.e. the distance between the hero and the specified monster), which is a very common use of distu(). The idea is that this would be a convenient shorthand for it; I actually thought it (or something very similar) existed already, but couldn't find it when I tried to use it earlier. Based on the number of uses of fully-spelled-out 'distu(mtmp->mx, mtmp->my)' replaced in this commit I'm guessing I just imagined it.
This commit is contained in:
@@ -26,7 +26,7 @@ static int passivemm(struct monst *, struct monst *, boolean, int,
|
||||
static void
|
||||
noises(register struct monst *magr, register struct attack *mattk)
|
||||
{
|
||||
boolean farq = (distu(magr->mx, magr->my) > 15);
|
||||
boolean farq = (mdistu(magr) > 15);
|
||||
|
||||
if (!Deaf && (farq != g.far_noise || g.moves - g.noisetime > 10)) {
|
||||
g.far_noise = farq;
|
||||
|
||||
Reference in New Issue
Block a user