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:
@@ -3288,8 +3288,7 @@ use_pole(struct obj *obj, boolean autohit)
|
||||
cc.y = u.uy;
|
||||
if (!find_poleable_mon(&cc, min_range, max_range) && hitm
|
||||
&& !DEADMONSTER(hitm) && sensemon(hitm)
|
||||
&& distu(hitm->mx, hitm->my) <= max_range
|
||||
&& distu(hitm->mx, hitm->my) >= min_range) {
|
||||
&& mdistu(hitm) <= max_range && mdistu(hitm) >= min_range) {
|
||||
cc.x = hitm->mx;
|
||||
cc.y = hitm->my;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user