Use macro for a location next to hero

This commit is contained in:
Pasi Kallinen
2022-02-12 11:05:07 +02:00
parent 2b4cf04281
commit 91e2d3633e
23 changed files with 53 additions and 50 deletions

View File

@@ -111,7 +111,7 @@ boulder_hits_pool(struct obj *otmp, int rx, int ry, boolean pushing)
docrt();
g.vision_full_recalc = 1;
You("find yourself on dry land again!");
} else if (lava && distu(rx, ry) <= 2) {
} else if (lava && next2u(rx, ry)) {
int dmg;
You("are hit by molten %s%c",
hliquid("lava"), Fire_resistance ? '.' : '!');
@@ -1267,7 +1267,7 @@ u_collide_m(struct monst *mtmp)
or else the monster to any nearby location. Prior to 3.3.0
the latter was done unconditionally. */
if (!rn2(2) && enexto(&cc, u.ux, u.uy, g.youmonst.data)
&& distu(cc.x, cc.y) <= 2)
&& next2u(cc.x, cc.y))
u_on_newpos(cc.x, cc.y); /*[maybe give message here?]*/
else
mnexto(mtmp, RLOC_NOMSG);