]> granicus.if.org Git - nethack/commitdiff
U303 - starting the game as a male valkyrie
authorcohrs <cohrs>
Sun, 25 May 2003 20:28:41 +0000 (20:28 +0000)
committercohrs <cohrs>
Sun, 25 May 2003 20:28:41 +0000 (20:28 +0000)
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.

doc/fixes34.2
src/role.c

index 7859f4ae17b81f6adb7756c128bbdef2021a603c..27946b4021be3130b81d52d7c18b3963f7aac3e6 100644 (file)
@@ -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
index d8954709ffea413808df2c596978276860bc320a..c751d10cf324ef42121df9bd3c7fc8d8f8b5f32a 100644 (file)
@@ -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))