Merge branch 'NetHack-3.6.0'
This commit is contained in:
44
src/botl.c
44
src/botl.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 botl.c $NHDT-Date: 1526427319 2018/05/15 23:35:19 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.92 $ */
|
||||
/* NetHack 3.6 botl.c $NHDT-Date: 1526597284 2018/05/17 22:48:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.93 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -892,7 +892,7 @@ status_finish()
|
||||
blstats[1][i].thresholds = blstats[0][i].thresholds;
|
||||
temp = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* STATUS_HILITES */
|
||||
}
|
||||
}
|
||||
@@ -1317,7 +1317,7 @@ int newcolor;
|
||||
|
||||
/*
|
||||
* get_hilite_color
|
||||
*
|
||||
*
|
||||
* Figures out, based on the value and the
|
||||
* direction it is moving, the color that the field
|
||||
* should be displayed in.
|
||||
@@ -1432,7 +1432,7 @@ int *colorptr;
|
||||
break;
|
||||
}
|
||||
hl = hl->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
*colorptr = bestcolor;
|
||||
return;
|
||||
@@ -1515,17 +1515,23 @@ boolean from_configfile;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* is str in the format of "(<>)?[0-9]+%?" regex */
|
||||
/* is str in the format of "[<>]?-?[0-9]+%?" regex */
|
||||
STATIC_OVL boolean
|
||||
is_ltgt_percentnumber(str)
|
||||
const char *str;
|
||||
{
|
||||
const char *s = str;
|
||||
|
||||
if (*s == '<' || *s == '>') s++;
|
||||
while (digit(*s)) s++;
|
||||
if (*s == '%') s++;
|
||||
|
||||
if (*s == '<' || *s == '>')
|
||||
s++;
|
||||
if (*s == '-')
|
||||
s++;
|
||||
/* note: this doesn't match the regexp shown above since it doesn't
|
||||
require at least one digit; but it's adequate for how it gets used */
|
||||
while (digit(*s))
|
||||
s++;
|
||||
if (*s == '%')
|
||||
s++;
|
||||
return (*s == '\0');
|
||||
}
|
||||
|
||||
@@ -1537,7 +1543,7 @@ const char *str;
|
||||
const char *s = str;
|
||||
|
||||
while (*s) {
|
||||
if (!index("<>0123456789%", *s))
|
||||
if (!index("<>-0123456789%", *s))
|
||||
return FALSE;
|
||||
s++;
|
||||
}
|
||||
@@ -1763,12 +1769,12 @@ boolean from_configfile;
|
||||
up = TRUE;
|
||||
changed = TRUE;
|
||||
goto do_rel;
|
||||
} else if (fld == BL_CAP
|
||||
} else if (fld == BL_CAP
|
||||
&& is_fld_arrayvalues(s[sidx], enc_stat,
|
||||
SLT_ENCUMBER, OVERLOADED+1, &kidx)) {
|
||||
txt = enc_stat[kidx];
|
||||
txtval = TRUE;
|
||||
goto do_rel;
|
||||
goto do_rel;
|
||||
} else if (fld == BL_ALIGN
|
||||
&& is_fld_arrayvalues(s[sidx], aligntxt, 0, 3, &kidx)) {
|
||||
txt = aligntxt[kidx];
|
||||
@@ -1794,7 +1800,8 @@ boolean from_configfile;
|
||||
(void) stripchars(tmpbuf, "%<>", tmp);
|
||||
tmp = tmpbuf;
|
||||
while (*tmp) {
|
||||
if (!index("0123456789", *tmp))
|
||||
if (!index("0123456789", *tmp)
|
||||
&& (*tmp != '-' || tmp > tmpbuf))
|
||||
return FALSE;
|
||||
tmp++;
|
||||
}
|
||||
@@ -1842,8 +1849,7 @@ do_rel:
|
||||
else
|
||||
hilite.rel = LT_VALUE;
|
||||
|
||||
if (initblstats[fld].anytype == ANY_STR
|
||||
&& (percent || numeric)) {
|
||||
if (initblstats[fld].anytype == ANY_STR && (percent || numeric)) {
|
||||
config_error_add("Field '%s' does not support numeric values",
|
||||
initblstats[fld].fldname);
|
||||
return FALSE;
|
||||
@@ -1901,7 +1907,7 @@ do_rel:
|
||||
if (c >= CLR_MAX || coloridx != -1)
|
||||
return FALSE;
|
||||
coloridx = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (coloridx == -1)
|
||||
coloridx = NO_COLOR;
|
||||
@@ -2125,7 +2131,7 @@ int sidx;
|
||||
if (!success)
|
||||
config_error_add("Missing condition(s)");
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
||||
Strcpy(buf, tmp);
|
||||
conditions_bitmask = str2conditionbitmask(buf);
|
||||
@@ -2199,7 +2205,7 @@ int sidx;
|
||||
if (k >= CLR_MAX)
|
||||
return FALSE;
|
||||
coloridx = k;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* set the bits in the appropriate member of the
|
||||
condition array according to color chosen as index */
|
||||
@@ -2227,7 +2233,7 @@ clear_status_hilites()
|
||||
blstats[1][i].thresholds = blstats[0][i].thresholds;
|
||||
temp = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mapglyph.c $NHDT-Date: 1448175698 2015/11/22 07:01:38 $ $NHDT-Branch: master $:$NHDT-Revision: 1.40 $ */
|
||||
/* NetHack 3.6 mapglyph.c $NHDT-Date: 1526429201 2018/05/16 00:06:41 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.47 $ */
|
||||
/* Copyright (c) David Cohrs, 1991 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -9,7 +9,12 @@
|
||||
#include "color.h"
|
||||
#define HI_DOMESTIC CLR_WHITE /* monst.c */
|
||||
|
||||
static int explcolors[] = {
|
||||
#if !defined(TTY_GRAPHICS)
|
||||
#define has_color(n) TRUE
|
||||
#endif
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
static const int explcolors[] = {
|
||||
CLR_BLACK, /* dark */
|
||||
CLR_GREEN, /* noxious */
|
||||
CLR_BROWN, /* muddy */
|
||||
@@ -19,11 +24,6 @@ static int explcolors[] = {
|
||||
CLR_WHITE, /* frosty */
|
||||
};
|
||||
|
||||
#if !defined(TTY_GRAPHICS)
|
||||
#define has_color(n) TRUE
|
||||
#endif
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
#define zap_color(n) color = iflags.use_color ? zapcolors[n] : NO_COLOR
|
||||
#define cmap_color(n) color = iflags.use_color ? defsyms[n].color : NO_COLOR
|
||||
#define obj_color(n) color = iflags.use_color ? objects[n].oc_color : NO_COLOR
|
||||
@@ -233,6 +233,8 @@ unsigned *ospecial;
|
||||
*ospecial = special;
|
||||
#ifdef TEXTCOLOR
|
||||
*ocolor = color;
|
||||
#else
|
||||
nhUse(ocolor);
|
||||
#endif
|
||||
return idx;
|
||||
}
|
||||
@@ -241,7 +243,7 @@ char *
|
||||
encglyph(glyph)
|
||||
int glyph;
|
||||
{
|
||||
static char encbuf[20];
|
||||
static char encbuf[20]; /* 10+1 would suffice */
|
||||
|
||||
Sprintf(encbuf, "\\G%04X%04X", context.rndencode, glyph);
|
||||
return encbuf;
|
||||
@@ -338,6 +340,7 @@ int attr;
|
||||
const char *str;
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
|
||||
/* now send it to the normal putstr */
|
||||
putstr(window, attr, decode_mixed(buf, str));
|
||||
}
|
||||
|
||||
@@ -1091,7 +1091,7 @@ char *buf;
|
||||
case 'D': /* current time, YYYYMMDDhhmmss */
|
||||
Sprintf(tmpbuf, "%08ld%06ld", yyyymmdd(now), hhmmss(now));
|
||||
break;
|
||||
case 'v': /* version, eg. "3.6.1-0" */
|
||||
case 'v': /* version, eg. "3.6.2-0" */
|
||||
Sprintf(tmpbuf, "%s", version_string(verbuf));
|
||||
break;
|
||||
case 'u': /* UID */
|
||||
|
||||
Reference in New Issue
Block a user