} else if (mvitals[monsndx(mdat)].mvflags & G_GENOD)
return 0; /* passed in mdat is genocided */
+ if (mdat == mtmp->data)
+ return 0; /* still the same monster */
+
mgender_from_permonst(mtmp, mdat);
if (In_endgame(&u.uz) && is_mplayer(olddata) && has_mname(mtmp)) {
*p = '\0';
}
- if (mdat == mtmp->data)
- return 0; /* still the same monster */
-
if (mtmp->wormno) { /* throw tail away */
wormgone(mtmp);
place_monster(mtmp, mtmp->mx, mtmp->my);
MNAME(mtmp) = save_mname;
}
+ /* when polymorph trap/wand/potion produces a vampire, turn in into
+ a full-fledged vampshifter unless shape-changing is blocked */
+ if (mtmp->cham == NON_PM && mdat->mlet == S_VAMPIRE
+ && !Protection_from_shape_changers)
+ mtmp->cham = pm_to_cham(monsndx(mdat));
+
possibly_unwield(mtmp, polyspot); /* might lose use of weapon */
mon_break_armor(mtmp, polyspot);
if (!(mtmp->misc_worn_check & W_ARMG))