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:
@@ -274,15 +274,9 @@ boolean allow_drag;
|
||||
u.ux0 = u.ux;
|
||||
u.uy0 = u.uy;
|
||||
|
||||
if (hides_under(youmonst.data))
|
||||
u.uundetected = OBJ_AT(nux, nuy);
|
||||
else if (youmonst.data->mlet == S_EEL)
|
||||
u.uundetected = is_pool(nux, nuy);
|
||||
else {
|
||||
u.uundetected = 0;
|
||||
/* mimics stop being unnoticed */
|
||||
if (youmonst.data->mlet == S_MIMIC)
|
||||
youmonst.m_ap_type = M_AP_NOTHING;
|
||||
if (!hideunder(&youmonst) && youmonst.data->mlet == S_MIMIC) {
|
||||
/* mimics stop being unnoticed */
|
||||
youmonst.m_ap_type = M_AP_NOTHING;
|
||||
}
|
||||
|
||||
if (u.uswallow) {
|
||||
|
||||
Reference in New Issue
Block a user