Fold invisible glyph unmapping into single function
This commit is contained in:
16
src/apply.c
16
src/apply.c
@@ -408,11 +408,8 @@ register struct obj *obj;
|
||||
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) {
|
||||
@@ -631,10 +628,7 @@ struct obj *obj;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -3030,11 +3024,7 @@ struct obj *obj;
|
||||
}
|
||||
} 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 */
|
||||
|
||||
Reference in New Issue
Block a user