Fix pet data being reset when charm monster was cast

Casting charm monster with pets nearby could reset the edog struct.
If the pet ate a mimic corpse and was pretending to be something else
when that edog reset happened, the sanity checking would issue an impossible.
The error happened because meating was reset, but the pet appearance was not,
but the edog struct reset is the part being wrong.  Lets not do that.

To reproduce, turn on sanity checking, create a tame dog, give it a mimic corpse
to eat, #wizcast charm monster next to it.
This commit is contained in:
Pasi Kallinen
2025-01-17 17:07:04 +02:00
parent c0a1ed9c41
commit 6df83cb677

View File

@@ -1208,8 +1208,10 @@ tamedog(
return FALSE;
/* add the pet extension */
newedog(mtmp);
initedog(mtmp);
if (!has_edog(mtmp)) {
newedog(mtmp);
initedog(mtmp);
}
if (obj) { /* thrown food */
/* defer eating until the edog extension has been set up */