Fix pet apport value

Fuzzer encountered a case where a pet apport ended up being zero:
the reviving tame troll already had edog structure, so it was not reset.
This commit is contained in:
Pasi Kallinen
2025-05-23 17:21:24 +03:00
parent ec8fab9d7a
commit 15ced6f1ff

View File

@@ -66,6 +66,9 @@ initedog(struct monst *mtmp, boolean everything)
edogp->revivals = 0;
edogp->mhpmax_penalty = 0;
edogp->killed_by_u = 0;
} else {
if (edogp->apport <= 0)
edogp->apport = 1;
}
/* always set for newly tamed pet or feral former pet; hungrytime might
already be higher when taming magic affects already tame monst */