Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-11-28 20:04:07 -05:00
43 changed files with 1603 additions and 726 deletions

View File

@@ -2096,8 +2096,12 @@ const char *gang, *other;
char buf[BUFSZ], buf2[BUFSZ], *orcname;
orcname = rndorcname(buf2);
sz = (int) ((gang ? strlen(gang) : other ? strlen(other) : 0)
+ strlen(orcname) + sizeof " of " - sizeof "");
sz = (int) strlen(orcname);
if (gang)
sz += (int) (strlen(gang) + sizeof " of " - sizeof "");
else if (other)
sz += (int) strlen(other);
if (sz < BUFSZ) {
char gbuf[BUFSZ];
boolean nameit = FALSE;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 files.c $NHDT-Date: 1542765358 2018/11/21 01:55:58 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.243 $ */
/* NetHack 3.6 files.c $NHDT-Date: 1543395733 2018/11/28 09:02:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.244 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2797,8 +2797,9 @@ const char *buf;
buf = "Unknown error";
if (!config_error_data) {
/* assumes pline() is using raw_printf() as this stage */
pline("config_error_add: %s.", buf);
/* either very early, where pline() will use raw_print(), or
player gave bad value when prompted by interactive 'O' command */
pline("%s%s.", !iflags.window_inited ? "config_error_add: " : "", buf);
wait_synch();
return;
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 options.c $NHDT-Date: 1526112322 2018/05/12 08:05:22 $ $NHDT-Branch: master $:$NHDT-Revision: 1.323 $ */
/* NetHack 3.6 options.c $NHDT-Date: 1543395749 2018/11/28 09:02:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.334 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -166,11 +166,6 @@ static struct Bool_Opt {
{ "menu_overlay", (boolean *) 0, FALSE, SET_IN_FILE },
#endif
{ "monpolycontrol", &iflags.mon_polycontrol, FALSE, SET_IN_WIZGAME },
#ifdef CURSES_GRAPHICS
{ "mouse_support", &iflags.wc_mouse_support, FALSE, DISP_IN_GAME }, /*WC*/
#else
{ "mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME }, /*WC*/
#endif
#ifdef NEWS
{ "news", &iflags.news, TRUE, DISP_IN_GAME },
#else
@@ -342,6 +337,7 @@ static struct Comp_Opt {
#endif
{ "name", "your character's name (e.g., name:Merlin-W)", PL_NSIZ,
DISP_IN_GAME },
{ "mouse_support", "game receives click info from mouse", 0, SET_IN_GAME },
{ "number_pad", "use the number pad for movement", 1, SET_IN_GAME },
{ "objects", "the symbols to use for objects", MAXOCLASSES, SET_IN_FILE },
{ "packorder", "the inventory order of the items in your pack",
@@ -2209,6 +2205,35 @@ boolean tinitial, tfrom_file;
return retval;
}
fullname = "mouse_support";
if (match_optname(opts, fullname, 13, TRUE)) {
boolean compat = (strlen(opts) <= 13);
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, (compat || !initial));
if (!op) {
if (compat || negated || initial) {
/* for backwards compatibility, "mouse_support" without a
value is a synonym for mouse_support:1 */
iflags.wc_mouse_support = !negated;
}
} else if (negated) {
bad_negation(fullname, TRUE);
return FALSE;
} else {
int mode = atoi(op);
if (mode < 0 || mode > 2 || (mode == 0 && *op != '0')) {
config_error_add("Illegal %s parameter '%s'", fullname, op);
return FALSE;
} else { /* mode >= 0 */
iflags.wc_mouse_support = mode;
}
}
return retval;
}
fullname = "number_pad";
if (match_optname(opts, fullname, 10, TRUE)) {
boolean compat = (strlen(opts) <= 10);
@@ -2263,8 +2288,9 @@ boolean tinitial, tfrom_file;
symset[ROGUESET].name = dupstr(op);
if (!read_sym_file(ROGUESET)) {
clear_symsetentry(ROGUESET, TRUE);
config_error_add("Unable to load symbol set \"%s\" from \"%s\"",
op, SYMBOLS);
config_error_add(
"Unable to load symbol set \"%s\" from \"%s\"",
op, SYMBOLS);
return FALSE;
} else {
if (!initial && Is_rogue_level(&u.uz))
@@ -5338,10 +5364,10 @@ get_compopt_value(optname, buf)
const char *optname;
char *buf;
{
char ocl[MAXOCLASSES + 1];
static const char none[] = "(none)", randomrole[] = "random",
to_be_done[] = "(to be done)", defopt[] = "default",
defbrief[] = "def";
to_be_done[] = "(to be done)",
defopt[] = "default", defbrief[] = "def";
char ocl[MAXOCLASSES + 1];
int i;
buf[0] = '\0';
@@ -5496,6 +5522,25 @@ char *buf;
#endif
} else if (!strcmp(optname, "name")) {
Sprintf(buf, "%s", plname);
} else if (!strcmp(optname, "mouse_support")) {
#ifdef WIN32
#define MOUSEFIX1 ", QuickEdit off"
#define MOUSEFIX2 ", QuickEdit unchanged"
#else
#define MOUSEFIX1 ", O/S adjusted"
#define MOUSEFIX2 ", O/S unchanged"
#endif
static const char *mousemodes[][2] = {
{ "0=off", "" },
{ "1=on", MOUSEFIX1 },
{ "2=on", MOUSEFIX2 },
};
#undef MOUSEFIX1
#undef MOUSEFIX2
int ms = iflags.wc_mouse_support;
if (ms >= 0 && ms <= 2)
Sprintf(buf, "%s%s", mousemodes[ms][0], mousemodes[ms][1]);
} else if (!strcmp(optname, "number_pad")) {
static const char *numpadmodes[] = {
"0=off", "1=on", "2=on, MSDOS compatible",

View File

@@ -1353,10 +1353,12 @@ static const char *suptext1[] = {
};
static const char *suptext2[] = {
"%s is a nefarious orc who is known to acquire",
"property from thieves and sell it off for profit",
"or gain. The perpetrator was last seen hanging",
"around the stairs leading to the Gnomish Mines.",
"\"%s\" is the common dungeon name of",
"a nefarious orc who is known to acquire property",
"from thieves and sell it off for profit.",
"",
"The perpetrator was last seen hanging around the",
"stairs leading to the Gnomish Mines.",
(char *) 0,
};