Fixes and sanity checks for monster undetected and trapped states

Adds sanity checks for mtrapped and mundetected states.

Fixes cases where those were left in wrong state.

1. Trapped monster (eg. a nymph) teleported out of a trap
2. Monster was hiding under ball or chain, which then got removed
3. While restoring a level, a zombie corpse revived while monster
   was hiding under it
4. A general case where the only object was deleted off floor and
   a monster was hiding under it

Monsters hiding under ball or chain will now get revealed when
the b or c are moved.
This commit is contained in:
Pasi Kallinen
2020-11-24 19:26:12 +02:00
parent 43379bffcc
commit 229930e505
7 changed files with 53 additions and 2 deletions

View File

@@ -2175,6 +2175,10 @@ struct obj *obj;
panic("dealloc_obj with nobj");
if (obj->cobj)
panic("dealloc_obj with cobj");
if (obj == uball || obj == uchain)
impossible("dealloc_obj called on %s, owornmask=%lx",
(obj == uball) ? "uball" : "uchain",
obj->owornmask);
/* free up any timers attached to the object */
if (obj->timed)