]> granicus.if.org Git - nethack/commitdiff
fix #H4065 - unnecessary role select confirmation
authorPatR <rankin@nethack.org>
Thu, 17 Dec 2015 14:37:08 +0000 (06:37 -0800)
committerPatR <rankin@nethack.org>
Thu, 17 Dec 2015 14:37:08 +0000 (06:37 -0800)
If player specified all four facets of role:  role, race, gender, and
alignment, via command line or option settings, the tty interface still
asked the player to confirm whether the character's role/&c was ok?
Skip that confirmation when all four things have already been chosen.

doc/fixes36.1
win/tty/wintty.c

index f27e377eb48707c4c612c5380af2fde408d38b0c..80dabedc865b5cb5337dec82a948aabae5492224 100644 (file)
@@ -42,6 +42,8 @@ Platform- and/or Interface-Specific Fixes
 -----------------------------------------
 tty: M-N gave "Unknown command 'M-" with "'." finishing the sentence on the
        line below it, leaving bogus '.' displayed on the top row of the map
+tty: specifying all four of role, race, gender, and alignment still prompted
+       for confirmation with "Is this ok?" before starting play
 unix/X11: in top level Makefile, some commented out definitions of VARDATND
        misspelled pilemark.xbm (as pilemark.xpm)
 win32gui: getversionstring() was overflowing the provided Help About buffer
index 2eace09e548076260c74a531a3c98b12077f890c..96cc9b1eeee7dc2cb6b1dd0787be8e0e823aaee2 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 wintty.c        $NHDT-Date: 1450320157 2015/12/17 02:42:37 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.117 $ */
+/* NetHack 3.6 wintty.c        $NHDT-Date: 1450363024 2015/12/17 14:37:04 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.118 $ */
 /* Copyright (c) David Cohrs, 1991                                */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -331,14 +331,25 @@ void
 tty_player_selection()
 {
     int i, k, n, choice, nextpick;
-    boolean getconfirmation;
+    boolean getconfirmation, picksomething;
     char pick4u = 'n';
     char pbuf[QBUFSZ], plbuf[QBUFSZ];
     winid win;
     anything any;
     menu_item *selected = 0;
 
-    if (flags.randomall) {
+    /* Used to avoid "Is this ok?" if player has already specified all
+     * four facets of role.
+     * Note that rigid_role_checks might force any unspecified facets to
+     * have a specific value, but that will still require confirmation;
+     * player can specify the forced ones if avoiding that is demanded.
+     */
+    picksomething = (ROLE == ROLE_NONE || RACE == ROLE_NONE
+                     || GEND == ROLE_NONE || ALGN == ROLE_NONE);
+    /* Used for '-@';
+     * choose randomly without asking for all unspecified facets.
+     */
+    if (flags.randomall && picksomething) {
         if (ROLE == ROLE_NONE)
             ROLE = ROLE_RANDOM;
         if (RACE == ROLE_NONE)
@@ -349,7 +360,8 @@ tty_player_selection()
             ALGN = ROLE_RANDOM;
     }
 
-    /* prevent an unnecessary prompt */
+    /* prevent unnecessary prompting if role forces race (samurai) or gender
+       (valkyrie) or alignment (rogue), or race forces alignment (orc), &c */
     rigid_role_checks();
 
     /* Should we randomly pick for the player? */
@@ -742,7 +754,7 @@ makepicks:
      *           q - quit
      *           (end)
      */
-    getconfirmation = (pick4u != 'a' && !flags.randomall);
+    getconfirmation = (picksomething && pick4u != 'a' && !flags.randomall);
     while (getconfirmation) {
         tty_clear_nhwindow(BASE_WINDOW);
         role_selection_prolog(ROLE_NONE, BASE_WINDOW);