fix #H5082 - growing into opposite sex monster
When a female dwarf grows (via level gain) into a dwarf lord, it changes sex as well as base monster form because all dwarf lords are male. The earlier fix for #H4276 (16-Mar-2016, to give an alternate grow-up message acknowledging the change) used the wrong monster form (monst's old one instead of new one).
This commit is contained in:
@@ -1793,11 +1793,11 @@ struct monst *mtmp, *victim;
|
||||
else if (lev_limit > 49)
|
||||
lev_limit = (ptr->mlevel > 49 ? 50 : 49);
|
||||
|
||||
/* new form might force gender change */
|
||||
fem = is_male(ptr) ? 0 : is_female(ptr) ? 1 : mtmp->female;
|
||||
|
||||
if ((int) ++mtmp->m_lev >= mons[newtype].mlevel && newtype != oldtype) {
|
||||
ptr = &mons[newtype];
|
||||
/* new form might force gender change */
|
||||
fem = is_male(ptr) ? 0 : is_female(ptr) ? 1 : mtmp->female;
|
||||
|
||||
if (mvitals[newtype].mvflags & G_GENOD) { /* allow G_EXTINCT */
|
||||
if (canspotmon(mtmp))
|
||||
pline("As %s grows up into %s, %s %s!", mon_nam(mtmp),
|
||||
@@ -1829,8 +1829,9 @@ struct monst *mtmp, *victim;
|
||||
set_mon_data(mtmp, ptr, 1); /* preserve intrinsics */
|
||||
newsym(mtmp->mx, mtmp->my); /* color may change */
|
||||
lev_limit = (int) mtmp->m_lev; /* never undo increment */
|
||||
|
||||
mtmp->female = fem; /* gender might be changing */
|
||||
}
|
||||
mtmp->female = fem; /* gender might be changing */
|
||||
|
||||
/* sanity checks */
|
||||
if ((int) mtmp->m_lev > lev_limit) {
|
||||
|
||||
Reference in New Issue
Block a user