Use u_at macro

This commit is contained in:
Pasi Kallinen
2022-02-23 20:28:55 +02:00
parent 2635c60280
commit 8e91320d2f
40 changed files with 126 additions and 130 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ goodpos(int x, int y, struct monst* mtmp, long gpflags)
* oh well.
*/
if (!allow_u) {
if (x == u.ux && y == u.uy && mtmp != &g.youmonst
if (u_at(x, y) && mtmp != &g.youmonst
&& (mtmp != u.ustuck || !u.uswallow)
&& (!u.usteed || mtmp != u.usteed))
return FALSE;
@@ -532,7 +532,7 @@ scrolltele(struct obj* scroll)
if (teleok(cc.x, cc.y, FALSE)) {
/* for scroll, discover it regardless of destination */
teleds(cc.x, cc.y, TELEDS_TELEPORT);
if (iflags.travelcc.x == u.ux && iflags.travelcc.y == u.uy)
if (u_at(iflags.travelcc.x, iflags.travelcc.y))
iflags.travelcc.x = iflags.travelcc.y = 0;
return;
}