E void FDECL(map_trap, (struct trap *, int));
E void FDECL(map_object, (struct obj *, int));
E void FDECL(map_invisible, (XCHAR_P, XCHAR_P));
+E boolean FDECL(unmap_invisible, (int, int));
E void FDECL(unmap_object, (int, int));
E void FDECL(map_location, (int, int, int));
E void FDECL(feel_newsym, (XCHAR_P, XCHAR_P));
map_invisible(rx, ry);
return res;
}
- if (glyph_is_invisible(levl[rx][ry].glyph)) {
- unmap_object(rx, ry);
- newsym(rx, ry);
+ if (unmap_invisible(rx,ry))
pline_The("invisible monster must have moved.");
- }
lev = &levl[rx][ry];
switch (lev->typ) {
if (!(mtmp = m_at(cc.x, cc.y))) {
There("is no creature there.");
- if (glyph_is_invisible(levl[cc.x][cc.y].glyph)) {
- unmap_object(cc.x, cc.y);
- newsym(cc.x, cc.y);
- }
+ (void) unmap_invisible(cc.x, cc.y);
return 1;
}
}
} else {
/* no monster here and no statue seen or remembered here */
- if (glyph_is_invisible(glyph)) {
- /* now you know that nothing is there... */
- unmap_object(bhitpos.x, bhitpos.y);
- newsym(bhitpos.x, bhitpos.y);
- }
+ (void) unmap_invisible(bhitpos.x, bhitpos.y);
You("miss; there is no one there to hit.");
}
u_wipe_engr(2); /* same as for melee or throwing */
}
if (!canspotmon(mtmp) && !glyph_is_invisible(levl[zx][zy].glyph))
map_invisible(zx, zy);
- } else if (glyph_is_invisible(levl[zx][zy].glyph)) {
- unmap_object(zx, zy);
- newsym(zx, zy);
+ } else if (unmap_invisible(zx, zy)) {
(*(int *) num)++;
}
}
/* see if an invisible monster has moved--if Blind,
* feel_location() already did it
*/
- if (!aflag && !mtmp && !Blind
- && glyph_is_invisible(levl[x][y].glyph)) {
- unmap_object(x, y);
- newsym(x, y);
- }
+ if (!aflag && !mtmp && !Blind)
+ (void) unmap_invisible(x, y);
if ((trap = t_at(x, y)) && !trap->tseen && !rnl(8)) {
nomul(0);
}
}
+boolean
+unmap_invisible(x, y)
+int x, y;
+{
+ if (isok(x,y) && glyph_is_invisible(levl[x][y].glyph)) {
+ unmap_object(x, y);
+ newsym(x, y);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
/*
* unmap_object()
*
} else {
maybe_mnexto(mon);
if (mon->mx != x || mon->my != y) {
- if (glyph_is_invisible(levl[x][y].glyph)) {
- unmap_object(x, y);
- newsym(x, y);
- }
+ (void) unmap_invisible(x, y);
pline("%s %s, %s evading your %skick.", Monnam(mon),
(!level.flags.noteleport && can_teleport(mon->data))
? "teleports"
}
return 1;
}
- if (glyph_is_invisible(levl[x][y].glyph)) {
- unmap_object(x, y);
- newsym(x, y);
- }
+ (void) unmap_invisible(x, y);
if (is_pool(x, y) ^ !!u.uinwater) {
/* objects normally can't be removed from water by kicking */
You("splash some %s around.", hliquid("water"));
}
if (mtmp && cansee(i + x - 1, j + y - 1) && !canspotmon(mtmp))
map_invisible(i + x - 1, j + y - 1);
- else if (!mtmp && glyph_is_invisible(
- levl[i + x - 1][j + y - 1].glyph)) {
- unmap_object(i + x - 1, j + y - 1);
- newsym(i + x - 1, j + y - 1);
- }
+ else if (!mtmp)
+ (void) unmap_invisible(i + x - 1, j + y - 1);
if (cansee(i + x - 1, j + y - 1))
visible = TRUE;
if (explmask[i][j] == 1)
}
return;
}
- if (glyph_is_invisible(levl[x][y].glyph)) {
- unmap_object(x, y);
- newsym(x, y);
- }
+ (void) unmap_invisible(x, y);
/* not attacking an animal, so we try to move */
if ((u.dx || u.dy) && u.usteed && stucksteed(FALSE)) {
nomul(0);
/* reveal/unreveal invisible monsters before tmp_at() */
if (mon && !canspotmon(mon))
map_invisible(sx, sy);
- else if (!mon && glyph_is_invisible(levl[sx][sy].glyph)) {
- unmap_object(sx, sy);
- newsym(sx, sy);
- }
+ else if (!mon)
+ (void) unmap_invisible(sx, sy);
if (ZAP_POS(levl[sx][sy].typ)
|| (isok(lsx, lsy) && cansee(lsx, lsy)))
tmp_at(sx, sy);