From: PatR Date: Tue, 21 Jun 2022 16:56:59 +0000 (-0700) Subject: tty perm_invent options again X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a0c1541dd9ca7da09e5a3bb48dbc3fc3b65fd5c;p=nethack tty perm_invent options again I'm not sure what happened but something that worked when I tested yesterday wouldn't work today. Have 'O' was pass TRUE rather than FALSE to tty_perm_invent_toggled() when perm_invent is set to 'on'. And skip that code for .nethackrc or NETHACKOPTIONS because it was segfaulting. --- diff --git a/src/options.c b/src/options.c index 0aaf1f997..4a24f4140 100644 --- a/src/options.c +++ b/src/options.c @@ -4410,16 +4410,15 @@ optfn_boolean(int optidx, int req, boolean negated, char *opts, char *op) tty_perm_invent_toggled() and routines it calls don't check iflags.perm_invent so it doesn't matter that 'SET IT HERE' hasn't been executed yet */ - if (WINDOWPORT("tty") && !negated) { - tty_perm_invent_toggled(!negated); + if (WINDOWPORT("tty") && !g.opt_initial && !negated) { + tty_perm_invent_toggled(FALSE); if (g.tty_invent_win == WIN_ERR) { /* FIXME: there is some confusion between this and tty_create_nhwindow(NHW_TTYINVENT) over when this should be done */ set_option_mod_status("perm_invent", set_gameview); - if (!g.opt_initial) - config_error_add("Enabling perm_invent failed"); + config_error_add("Enabling perm_invent failed"); return optn_silenterr; } }