Use u_at macro

This commit is contained in:
Pasi Kallinen
2022-02-23 20:28:35 +02:00
parent 2635c60280
commit 8e91320d2f
40 changed files with 126 additions and 130 deletions

View File

@@ -166,7 +166,7 @@ flooreffects(struct obj *obj, int x, int y, const char *verb)
ttyp = t->ttyp;
tseen = t->tseen ? TRUE : FALSE;
if (((mtmp = m_at(x, y)) && mtmp->mtrapped)
|| (u.utrap && u.ux == x && u.uy == y)) {
|| (u.utrap && u_at(x,y))) {
if (*verb && (cansee(x, y) || distu(x, y) == 0))
pline("%s boulder %s into the pit%s.",
Blind ? "A" : "The",
@@ -213,7 +213,7 @@ flooreffects(struct obj *obj, int x, int y, const char *verb)
}
}
if (*verb) {
if (Blind && (x == u.ux) && (y == u.uy)) {
if (Blind && u_at(x, y)) {
You_hear("a CRASH! beneath you.");
} else if (!Blind && cansee(x, y)) {
pline_The("boulder %s%s.",
@@ -244,8 +244,7 @@ flooreffects(struct obj *obj, int x, int y, const char *verb)
/* Reasonably bulky objects (arbitrary) splash when dropped.
* If you're floating above the water even small things make
* noise. Stuff dropped near fountains always misses */
if ((Blind || (Levitation || Flying)) && !Deaf
&& ((x == u.ux) && (y == u.uy))) {
if ((Blind || (Levitation || Flying)) && !Deaf && u_at(x, y)) {
if (!Underwater) {
if (weight(obj) > 9) {
pline("Splash!");
@@ -257,7 +256,7 @@ flooreffects(struct obj *obj, int x, int y, const char *verb)
newsym(x, y);
}
res = water_damage(obj, NULL, FALSE) == ER_DESTROYED;
} else if (u.ux == x && u.uy == y && (t = t_at(x, y)) != 0
} else if (u_at(x, y) && (t = t_at(x, y)) != 0
&& (uteetering_at_seen_pit(t) || uescaped_shaft(t))) {
if (is_pit(t->ttyp)) {
if (Blind && !Deaf)