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:
@@ -302,7 +302,7 @@ deadbook(struct obj* book2)
|
||||
&& cansee(mtmp->mx, mtmp->my)) {
|
||||
mtmp->mpeaceful = TRUE;
|
||||
if (sgn(mtmp->data->maligntyp) == sgn(u.ualign.type)
|
||||
&& distu(mtmp->mx, mtmp->my) < 4)
|
||||
&& mdistu(mtmp) < 4)
|
||||
if (mtmp->mtame) {
|
||||
if (mtmp->mtame < 20)
|
||||
mtmp->mtame++;
|
||||
|
||||
Reference in New Issue
Block a user