3.7: goldX and other stuff

Move option variable goldX (True: treat gold as BUC unknown, False:
treat gold as uncursed during BUCX filtering) from iflags to flags
so that it persists across save/restore.

Get rid of a few obsolete things from struct flags.

Try to make the 'cursesgraphics' option work although I don't think
that it was ever functional enough for anybody to use so probably
could have been removed instead.

Bump EDITLEVEL; any current save files are invalid.

Demote status from Beta to Work-in-Progress.

I modified src/sfdata.c manually (not included here) to get a full
build.  The Unix Makefile.src needs to be taught when and how to
regenerate it.
This commit is contained in:
PatR
2019-11-28 15:00:54 -08:00
parent 654203f0ba
commit adc455129d
6 changed files with 23 additions and 56 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 invent.c $NHDT-Date: 1573346190 2019/11/10 00:36:30 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.266 $ */
/* NetHack 3.6 invent.c $NHDT-Date: 1574982020 2019/11/28 23:00:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.280 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2895,7 +2895,7 @@ boolean FDECL((*filterfunc), (OBJ_P));
/* coins are either uncursed or unknown based upon option setting */
if (list->oclass == COIN_CLASS) {
if (type == (iflags.goldX ? BUC_UNKNOWN : BUC_UNCURSED))
if (type == (flags.goldX ? BUC_UNKNOWN : BUC_UNCURSED))
++count;
continue;
}
@@ -2931,7 +2931,7 @@ int *bcp, *ucp, *ccp, *xcp, *ocp;
list->bknown = (list->oclass != COIN_CLASS);
/* coins are either uncursed or unknown based upon option setting */
if (list->oclass == COIN_CLASS) {
if (iflags.goldX)
if (flags.goldX)
++(*xcp);
else
++(*ucp);
@@ -3095,7 +3095,7 @@ struct obj *obj;
/* if filtering by bless/curse state, gold is classified as
either unknown or uncursed based on user option setting */
if (g.this_type && index("BUCX", g.this_type))
res = (g.this_type == (iflags.goldX ? 'X' : 'U'));
res = (g.this_type == (flags.goldX ? 'X' : 'U'));
} else {
switch (g.this_type) {
case 'B':

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 options.c $NHDT-Date: 1574900826 2019/11/28 00:27:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.388 $ */
/* NetHack 3.6 options.c $NHDT-Date: 1574982022 2019/11/28 23:00:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.416 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -134,7 +134,7 @@ static const struct Bool_Opt {
#endif
{ "force_invmenu", &iflags.force_invmenu, FALSE, SET_IN_GAME },
{ "fullscreen", &iflags.wc2_fullscreen, FALSE, SET_IN_FILE }, /*WC2*/
{ "goldX", &iflags.goldX, FALSE, SET_IN_GAME },
{ "goldX", &flags.goldX, FALSE, SET_IN_GAME },
{ "guicolor", &iflags.wc2_guicolor, TRUE, SET_IN_GAME}, /*WC2*/
{ "help", &flags.help, TRUE, SET_IN_GAME },
{ "herecmd_menu", &iflags.herecmd_menu, FALSE, SET_IN_GAME },
@@ -3840,10 +3840,13 @@ boolean tinitial, tfrom_file;
}
fullname = "DECgraphics";
if (match_optname(opts, fullname, 3, TRUE)) {
if (match_optname(opts, fullname, 3, FALSE)
|| match_optname(opts, "cursesgraphics", 4, FALSE)) {
#ifdef BACKWARD_COMPAT
boolean badflag = FALSE;
if (lowc(*opts) == 'c')
fullname = "curses"; /* symbol set name is shorter than optname */
if (duplicate)
complain_about_duplicate(opts, 1);
if (!negated) {
@@ -4052,9 +4055,6 @@ boolean tinitial, tfrom_file;
|| boolopt[i].addr == &iflags.use_inverse
|| boolopt[i].addr == &iflags.hilite_pile
|| boolopt[i].addr == &iflags.perm_invent
#ifdef CURSES_GRAPHICS
|| boolopt[i].addr == &iflags.cursesgraphics
#endif
|| boolopt[i].addr == &iflags.wc_ascii_map
|| boolopt[i].addr == &iflags.wc_tiled_map) {
g.opt_need_redraw = TRUE;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pickup.c $NHDT-Date: 1570566381 2019/10/08 20:26:21 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.235 $ */
/* NetHack 3.6 pickup.c $NHDT-Date: 1574982023 2019/11/28 23:00:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.249 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -392,7 +392,7 @@ struct obj *obj;
: g.shop_filter /* coins are never unpaid, but check anyway */
? (obj->unpaid ? TRUE : FALSE)
: g.bucx_filter
? (index(g.valid_menu_classes, iflags.goldX ? 'X' : 'U')
? (index(g.valid_menu_classes, flags.goldX ? 'X' : 'U')
? TRUE : FALSE)
: TRUE; /* catchall: no filters specified, so accept */