From: cohrs Date: Sun, 25 May 2003 20:28:41 +0000 (+0000) Subject: U303 - starting the game as a male valkyrie X-Git-Tag: MOVE2GIT~1954 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f712ac62674278c2dcafa88f2f67c3db9dbb5db;p=nethack U303 - starting the game as a male valkyrie A core fixup if the the port startup code sets an invalid flags.female when starting a new game. The old comment regarding being unable to change flags.female was not completely correct. The flags.pantheon can be used to differenciate new games from a restored game. --- diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 7859f4ae1..27946b402 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -78,6 +78,7 @@ several sit-in-trap cases were unreachable curse candelabrum in bones, like other similar artifacts detecting a trap in a chest while confused should not exercise wisdom any golem statue hit with stone-to-flesh spell animates as flesh golem +correct invalid startup gender selection Platform- and/or Interface-Specific Fixes diff --git a/src/role.c b/src/role.c index d8954709f..c751d10cf 100644 --- a/src/role.c +++ b/src/role.c @@ -1368,13 +1368,15 @@ role_init() if (!validrace(flags.initrole, flags.initrace)) flags.initrace = randrace(flags.initrole); - /* Check for a valid gender. Try flags.igend first. */ + /* Check for a valid gender. If new game, check both initgend + * and female. On restore, assume flags.female is correct. */ + if (flags.pantheon == -1) { /* new game */ + if (!validgend(flags.initrole, flags.initrace, flags.female)) + flags.female = !flags.female; + } if (!validgend(flags.initrole, flags.initrace, flags.initgend)) - /* Use flags.female second. Note that there is no way - * to check for an unspecified gender. - */ + /* Note that there is no way to check for an unspecified gender. */ flags.initgend = flags.female; - /* Don't change flags.female; this may be a restore */ /* Check for a valid alignment */ if (!validalign(flags.initrole, flags.initrace, flags.initalign))