]> granicus.if.org Git - nethack/commitdiff
environment variable TTYINV ignored
authornhmall <nhmall@nethack.org>
Sat, 25 Jun 2022 00:39:15 +0000 (20:39 -0400)
committernhmall <nhmall@nethack.org>
Sat, 25 Jun 2022 00:39:15 +0000 (20:39 -0400)
> Setting TTTINV in the environment no longer has any effect
> for me.

Variable was set immediately prior to the all-zeros
initialization. Fix the ordering of the two statements.

src/invent.c

index 236f1ea0ad4dc140ac653d463164d09d7f19890c..630c7f452c2e70cda54132b81325bc8c75b525e2 100644 (file)
@@ -5412,8 +5412,8 @@ core_update_invent_slot()
             char *envtmp = nh_getenv("TTYINV");
             invmode = envtmp ? atoi(envtmp) : InvNormal;
         }
-        pi_info.fromcore.invmode = invmode;
         pi_info = zeropi;
+        pi_info.fromcore.invmode = invmode;
         /* Send the wport a request to get the related settings. */
         pi_info.fromcore.core_request = request_settings;
         if ((pi = update_invent_slot(g.perm_invent_win, (slot = 0), &pi_info))) {