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:
10
src/pickup.c
10
src/pickup.c
@@ -585,13 +585,13 @@ end_query:
|
||||
}
|
||||
|
||||
if (!u.uswallow) {
|
||||
if (!OBJ_AT(u.ux,u.uy)) u.uundetected = 0;
|
||||
if (hides_under(youmonst.data)) (void) hideunder(&youmonst);
|
||||
|
||||
/* position may need updating (invisible hero) */
|
||||
if (n_picked) newsym(u.ux,u.uy);
|
||||
/* position may need updating (invisible hero) */
|
||||
if (n_picked) newsym(u.ux,u.uy);
|
||||
|
||||
/* see whether there's anything else here, after auto-pickup is done */
|
||||
if (autopickup) check_here(n_picked > 0);
|
||||
/* check if there's anything else here after auto-pickup is done */
|
||||
if (autopickup) check_here(n_picked > 0);
|
||||
}
|
||||
return (n_tried > 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user