hiding under a cockatrice corpse

Reported a while back, a (stonable) hiding monster will hide at a location
containing only a cockatrice corpse.  While it would be interesting to
allow monsters to try, and stone themselves as a result, I chose the
simpler fix which is to not have monsters hide in such situations.  I found
the hiding code was duplicated in several places, so I moved it into a new
hideunder() function that works for both the hero and monsters.
This commit is contained in:
cohrs
2003-10-10 23:01:42 +00:00
parent 219e091d82
commit 8ee1ecd2ea
10 changed files with 45 additions and 37 deletions

View File

@@ -1339,12 +1339,9 @@ domove()
nomul(0);
}
if (hides_under(youmonst.data))
u.uundetected = OBJ_AT(u.ux, u.uy);
else if (youmonst.data->mlet == S_EEL)
u.uundetected = is_pool(u.ux, u.uy) && !Is_waterlevel(&u.uz);
else if (u.dx || u.dy)
u.uundetected = 0;
if (hides_under(youmonst.data) || (youmonst.data->mlet == S_EEL) ||
u.dx || u.dy)
(void) hideunder(&youmonst);
/*
* Mimics (or whatever) become noticeable if they move and are