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:
@@ -924,8 +924,7 @@ register int mmflags;
|
||||
if(in_mklev)
|
||||
if(x && y)
|
||||
(void) mkobj_at(0, x, y, TRUE);
|
||||
if(hides_under(ptr) && OBJ_AT(x, y))
|
||||
mtmp->mundetected = TRUE;
|
||||
(void) hideunder(mtmp);
|
||||
break;
|
||||
case S_LIGHT:
|
||||
case S_ELEMENTAL:
|
||||
@@ -935,8 +934,7 @@ register int mmflags;
|
||||
}
|
||||
break;
|
||||
case S_EEL:
|
||||
if (is_pool(x, y))
|
||||
mtmp->mundetected = TRUE;
|
||||
(void) hideunder(mtmp);
|
||||
break;
|
||||
case S_LEPRECHAUN:
|
||||
mtmp->msleeping = 1;
|
||||
|
||||
Reference in New Issue
Block a user