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:
PatR
2017-02-17 12:24:24 -08:00
parent bfab1aa5b6
commit 8c92d2921f
2 changed files with 8 additions and 4 deletions

View File

@@ -391,6 +391,9 @@ when picking a destination for #jump, '$' to show valid dest. is more accurate
enchant armor gave "your pair of boots/gloves glow", should have been "glows"
when autopickup is overridden in a shop, always-pick-up exceptions and
pickup_thrown still picked unpaid items up
the fix for giving an alternate grow up message when a monster becomes a new
form with the opposite sex (female gnome into male gnome lord, for
example) had the logic wrong
Platform- and/or Interface-Specific Fixes

View File

@@ -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) {