similar problem with more obvious symptom, an "object lost" panic when
the unholy water was wielded; the fix for that wasn't general enough]
add MM_ASLEEP makemon() flag and honor it when creating group for fill_zoo
-at start of session (new game or restore), HILITE_STATUS for gold was ignored
-if player creates any menu colors via 'O' while menucolors is off, issue a
- reminder that it needs to be on in order for those to become effective
add MM_NOGRP makemon() flag as a means of suppressing groups of monsters in
a couple places that warrant it when a specific monster type isn't
specified on the call to makemon()
+at start of session (new game or restore), HILITE_STATUS for gold was ignored
+if player creates any menu colors via 'O' while menucolors is off, issue a
+ reminder that it needs to be on in order for those to become effective
+setting second or later named fruit to value beginning with two or more spaces
+ followed by non-space gave "singular of null?" warning
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
-/* NetHack 3.6 options.c $NHDT-Date: 1544174413 2018/12/07 09:20:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.339 $ */
+/* NetHack 3.6 options.c $NHDT-Date: 1544396581 2018/12/09 23:03:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.340 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
return;
}
+/* copy up to maxlen-1 characters; 'dest' must be able to hold maxlen;
+ treat comma as alternate end of 'src' */
STATIC_OVL void
nmcpy(dest, src, maxlen)
char *dest;
break; /*exit on \0 terminator*/
*dest++ = *src++;
}
- *dest = 0;
+ *dest = '\0';
}
/*
if (duplicate)
complain_about_duplicate(opts, 1);
- op = string_for_opt(opts, negated);
+ op = string_for_opt(opts, negated || !initial);
if (negated) {
if (op) {
bad_negation("fruit", TRUE);
}
if (!op)
return FALSE;
+ /* 3.6.2: strip leading and trailing spaces, condense internal ones */
+ mungspaces(op);
if (!initial) {
struct fruit *f;
int fnum = 0;
/* boolean option */
Sprintf(buf, "%s%s", *boolopt[opt_indx].addr ? "!" : "",
boolopt[opt_indx].name);
- parseoptions(buf, setinitial, fromfile);
+ (void) parseoptions(buf, setinitial, fromfile);
if (wc_supported(boolopt[opt_indx].name)
|| wc2_supported(boolopt[opt_indx].name))
preference_update(boolopt[opt_indx].name);
continue;
Sprintf(buf, "%s:%s", compopt[opt_indx].name, buf2);
/* pass the buck */
- parseoptions(buf, setinitial, fromfile);
+ (void) parseoptions(buf, setinitial, fromfile);
}
if (wc_supported(compopt[opt_indx].name)
|| wc2_supported(compopt[opt_indx].name))
destroy_nhwindow(tmpwin);
} else if (!strcmp("pickup_types", optname)) {
/* parseoptions will prompt for the list of types */
- parseoptions(strcpy(buf, "pickup_types"), setinitial, setfromfile);
+ (void) parseoptions(strcpy(buf, "pickup_types"),
+ setinitial, setfromfile);
} else if (!strcmp("disclose", optname)) {
/* order of disclose_names[] must correspond to
disclosure_options in decl.c */