Genetic engineer uses up turn when polying a monster

The fuzzer encountered a "no monster to remove" impossible,
this should fix it, even though I did not manage to reproduce
it manually.
This commit is contained in:
Pasi Kallinen
2023-05-06 20:16:28 +03:00
parent d036116dee
commit fe3dcb4416
+8 -1
View File
@@ -3467,6 +3467,8 @@ mhitm_ad_poly(
pline("%s is not transformed.", Monnam(mdef)); pline("%s is not transformed.", Monnam(mdef));
} else { } else {
mhm->damage = mon_poly(&gy.youmonst, mdef, mhm->damage); mhm->damage = mon_poly(&gy.youmonst, mdef, mhm->damage);
mhm->hitflags |= M_ATTK_HIT;
mhm->done = TRUE;
} }
} }
} else if (mdef == &gy.youmonst) { } else if (mdef == &gy.youmonst) {
@@ -3478,12 +3480,17 @@ mhitm_ad_poly(
You("aren't transformed."); You("aren't transformed.");
} else { } else {
mhm->damage = mon_poly(magr, &gy.youmonst, mhm->damage); mhm->damage = mon_poly(magr, &gy.youmonst, mhm->damage);
mhm->hitflags |= M_ATTK_HIT;
mhm->done = TRUE;
} }
} }
} else { } else {
/* mhitm */ /* mhitm */
if (mhm->damage < mdef->mhp && !negated) if (mhm->damage < mdef->mhp && !negated) {
mhm->damage = mon_poly(magr, mdef, mhm->damage); mhm->damage = mon_poly(magr, mdef, mhm->damage);
mhm->hitflags |= M_ATTK_HIT;
mhm->done = TRUE;
}
} }
} }