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:
2
src/do.c
2
src/do.c
@@ -2035,7 +2035,7 @@ revive_corpse(struct obj *corpse)
|
||||
pline("%s claws itself out of the ground!",
|
||||
canspotmon(mtmp) ? Amonnam(mtmp) : Something);
|
||||
newsym(mtmp->mx, mtmp->my);
|
||||
} else if (distu(mtmp->mx, mtmp->my) < 5*5)
|
||||
} else if (mdistu(mtmp) < 5*5)
|
||||
You_hear("scratching noises.");
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user