From 689aed55ca88d118d0f20d16950830c987e88a2f Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 14 Jan 2022 14:09:00 -0800 Subject: [PATCH] remove unused roles[].femalenum, races[].femalenum and rename {roles,races}[].malenum to {roles,races}[].mnum. Pull request #653 from entrez. Male and female player character monsters are no long separate even when their title's differ and all the entries for femalenum in the roles[] and races[] arrays were set to NON_PM (meaning not used in this case). The update in the pull request overlooked win/Qt/qt_plsel.cpp which had four references to .malenum so this is more than just the fixes entry. Closes #653 --- doc/fixes37.0 | 2 ++ win/Qt/qt_plsel.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 1200bc39e..852e277be 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1580,4 +1580,6 @@ map_glyphinfo() now simply references an internal array that maps each unique in-game that could have an impact on the mappings, but they remain stable between those events added MG_MALE glyphflag to complement the MG_FEMALE glyphflag that was there +remove obsolete roles[].femalenum and rename roles[].malenum to roles[].mnum; + likewise for races[] diff --git a/win/Qt/qt_plsel.cpp b/win/Qt/qt_plsel.cpp index 878cfb4f0..92060e8fc 100644 --- a/win/Qt/qt_plsel.cpp +++ b/win/Qt/qt_plsel.cpp @@ -312,7 +312,7 @@ NetHackQtPlayerSelector::NetHackQtPlayerSelector( item = new QTableWidgetItem(); role->setItem(i, 0, item); - if (roles[i].malenum == PM_CLERIC) + if (roles[i].mnum == PM_CLERIC) cleric_role_row = i; // for populate_races() } @@ -323,7 +323,7 @@ NetHackQtPlayerSelector::NetHackQtPlayerSelector( item = new QTableWidgetItem(); race->setItem(i, 0, item); - if (races[i].malenum == PM_HUMAN) + if (races[i].mnum == PM_HUMAN) human_race_row = i; // (always i==0) for populate_roles() } @@ -405,7 +405,7 @@ NetHackQtPlayerSelector::populate_roles() for (int i = 0; roles[i].name.m; ++i) { rolename = (is_f && roles[i].name.f) ? roles[i].name.f : roles[i].name.m; - gf = monnum_to_glyph(roles[i].malenum, is_f ? FEMALE : MALE); + gf = monnum_to_glyph(roles[i].mnum, is_f ? FEMALE : MALE); map_glyphinfo(0, 0, gf, 0, &gi); v = ((ra < 0 || validrace(i, ra)) && (gn < 0 || validgend(i, (ra >= 0) ? ra : hu, gn)) @@ -435,7 +435,7 @@ NetHackQtPlayerSelector::populate_races() bool is_f = (gn == 1); NetHackQtGlyphs& glyphs = qt_settings->glyphs(); for (int j = 0; races[j].noun; ++j) { - gf = monnum_to_glyph(races[j].malenum, is_f ? FEMALE : MALE); + gf = monnum_to_glyph(races[j].mnum, is_f ? FEMALE : MALE); map_glyphinfo(0, 0, gf, 0, &gi); v = ((ro < 0 || validrace(ro, j)) && (al < 0 || validalign((ro >= 0) ? ro : cl, j, al)));