fix #H7160 - hilite thresholds reject negatives
There was a prior report about this but I can't find it; maybe it didn't go through the web contact form. Anyway, status_hilite threshold numeric values wouldn't accept a minus sign before the digits, preventing negative AC values from being tracked.
This commit is contained in:
+9
-8
@@ -9,9 +9,10 @@ General Fixes and Modified Features
|
|||||||
-----------------------------------
|
-----------------------------------
|
||||||
last line of config file wasn't being heeded if it had no newline
|
last line of config file wasn't being heeded if it had no newline
|
||||||
list MSGTYPE values shows empty strings as reported in H7140
|
list MSGTYPE values shows empty strings as reported in H7140
|
||||||
Killing Vlad while he was in bat/fog cloud/wolf form gave poorly
|
Killing Vlad while he was in bat/fog cloud/wolf form gave poorly worded
|
||||||
worded feedback when he reverted to vampire form
|
feedback when he reverted to vampire form
|
||||||
spaces in hilite_status option title text field not working
|
spaces in hilite_status option title text field not working
|
||||||
|
numeric hilite_status values didn't allow negative numbers (needed for AC)
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||||
@@ -25,11 +26,11 @@ windows-gui: In nethackw, there could be conflicts between menu accelerators
|
|||||||
and an extra choice accelerator to fix H7132.
|
and an extra choice accelerator to fix H7132.
|
||||||
windows-tty: Specify both width and height when creating font for width testing
|
windows-tty: Specify both width and height when creating font for width testing
|
||||||
windows-tty: To counter lag problems that were occuring with the Win32 console
|
windows-tty: To counter lag problems that were occuring with the Win32 console
|
||||||
port, implement a console back buffer to reduce the number of calls made to
|
port, implement a console back buffer to reduce the number of calls
|
||||||
WriteConsoleOutputXXX
|
made to WriteConsoleOutputXXX
|
||||||
windows-tty: Additional changes to xputc_core() and early_raw_print() to manage
|
windows-tty: Additional changes to xputc_core() and early_raw_print() to
|
||||||
the cursor position correctly as that is needed to handle raw printing
|
manage the cursor position correctly as that is needed to handle
|
||||||
correctly
|
raw printing correctly
|
||||||
windows-tty: Added check for when we might be running off the bottom of the
|
windows-tty: Added check for when we might be running off the bottom of the
|
||||||
screen when handling msmsg()
|
screen when handling msmsg()
|
||||||
windows-tty: Added runtime checks to keep cursor always within bounds
|
windows-tty: Added runtime checks to keep cursor always within bounds
|
||||||
@@ -38,7 +39,7 @@ windows-tty: Use nhraykey by default if the players keyboard layout is
|
|||||||
non-english as reported in H4216
|
non-english as reported in H4216
|
||||||
windows-tty: We now support changing altkeyhandler in game
|
windows-tty: We now support changing altkeyhandler in game
|
||||||
windows: Added ntassert() mechanism for Windows based port use
|
windows: Added ntassert() mechanism for Windows based port use
|
||||||
tty: some optimizations for performance and per field rendering
|
tty: significant optimizations for performance and per field rendering
|
||||||
|
|
||||||
|
|
||||||
General New Features
|
General New Features
|
||||||
|
|||||||
+25
-19
@@ -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) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Michael Allison, 2006. */
|
/*-Copyright (c) Michael Allison, 2006. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -892,7 +892,7 @@ status_finish()
|
|||||||
blstats[1][i].thresholds = blstats[0][i].thresholds;
|
blstats[1][i].thresholds = blstats[0][i].thresholds;
|
||||||
temp = next;
|
temp = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* STATUS_HILITES */
|
#endif /* STATUS_HILITES */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1317,7 +1317,7 @@ int newcolor;
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* get_hilite_color
|
* get_hilite_color
|
||||||
*
|
*
|
||||||
* Figures out, based on the value and the
|
* Figures out, based on the value and the
|
||||||
* direction it is moving, the color that the field
|
* direction it is moving, the color that the field
|
||||||
* should be displayed in.
|
* should be displayed in.
|
||||||
@@ -1432,7 +1432,7 @@ int *colorptr;
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
hl = hl->next;
|
hl = hl->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*colorptr = bestcolor;
|
*colorptr = bestcolor;
|
||||||
return;
|
return;
|
||||||
@@ -1515,17 +1515,23 @@ boolean from_configfile;
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* is str in the format of "(<>)?[0-9]+%?" regex */
|
/* is str in the format of "[<>]?-?[0-9]+%?" regex */
|
||||||
STATIC_OVL boolean
|
STATIC_OVL boolean
|
||||||
is_ltgt_percentnumber(str)
|
is_ltgt_percentnumber(str)
|
||||||
const char *str;
|
const char *str;
|
||||||
{
|
{
|
||||||
const char *s = str;
|
const char *s = str;
|
||||||
|
|
||||||
if (*s == '<' || *s == '>') s++;
|
if (*s == '<' || *s == '>')
|
||||||
while (digit(*s)) s++;
|
s++;
|
||||||
if (*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');
|
return (*s == '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1537,7 +1543,7 @@ const char *str;
|
|||||||
const char *s = str;
|
const char *s = str;
|
||||||
|
|
||||||
while (*s) {
|
while (*s) {
|
||||||
if (!index("<>0123456789%", *s))
|
if (!index("<>-0123456789%", *s))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
@@ -1763,12 +1769,12 @@ boolean from_configfile;
|
|||||||
up = TRUE;
|
up = TRUE;
|
||||||
changed = TRUE;
|
changed = TRUE;
|
||||||
goto do_rel;
|
goto do_rel;
|
||||||
} else if (fld == BL_CAP
|
} else if (fld == BL_CAP
|
||||||
&& is_fld_arrayvalues(s[sidx], enc_stat,
|
&& is_fld_arrayvalues(s[sidx], enc_stat,
|
||||||
SLT_ENCUMBER, OVERLOADED+1, &kidx)) {
|
SLT_ENCUMBER, OVERLOADED+1, &kidx)) {
|
||||||
txt = enc_stat[kidx];
|
txt = enc_stat[kidx];
|
||||||
txtval = TRUE;
|
txtval = TRUE;
|
||||||
goto do_rel;
|
goto do_rel;
|
||||||
} else if (fld == BL_ALIGN
|
} else if (fld == BL_ALIGN
|
||||||
&& is_fld_arrayvalues(s[sidx], aligntxt, 0, 3, &kidx)) {
|
&& is_fld_arrayvalues(s[sidx], aligntxt, 0, 3, &kidx)) {
|
||||||
txt = aligntxt[kidx];
|
txt = aligntxt[kidx];
|
||||||
@@ -1794,7 +1800,8 @@ boolean from_configfile;
|
|||||||
(void) stripchars(tmpbuf, "%<>", tmp);
|
(void) stripchars(tmpbuf, "%<>", tmp);
|
||||||
tmp = tmpbuf;
|
tmp = tmpbuf;
|
||||||
while (*tmp) {
|
while (*tmp) {
|
||||||
if (!index("0123456789", *tmp))
|
if (!index("0123456789", *tmp)
|
||||||
|
&& (*tmp != '-' || tmp > tmpbuf))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
tmp++;
|
tmp++;
|
||||||
}
|
}
|
||||||
@@ -1842,8 +1849,7 @@ do_rel:
|
|||||||
else
|
else
|
||||||
hilite.rel = LT_VALUE;
|
hilite.rel = LT_VALUE;
|
||||||
|
|
||||||
if (initblstats[fld].anytype == ANY_STR
|
if (initblstats[fld].anytype == ANY_STR && (percent || numeric)) {
|
||||||
&& (percent || numeric)) {
|
|
||||||
config_error_add("Field '%s' does not support numeric values",
|
config_error_add("Field '%s' does not support numeric values",
|
||||||
initblstats[fld].fldname);
|
initblstats[fld].fldname);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -1901,7 +1907,7 @@ do_rel:
|
|||||||
if (c >= CLR_MAX || coloridx != -1)
|
if (c >= CLR_MAX || coloridx != -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
coloridx = c;
|
coloridx = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (coloridx == -1)
|
if (coloridx == -1)
|
||||||
coloridx = NO_COLOR;
|
coloridx = NO_COLOR;
|
||||||
@@ -2125,7 +2131,7 @@ int sidx;
|
|||||||
if (!success)
|
if (!success)
|
||||||
config_error_add("Missing condition(s)");
|
config_error_add("Missing condition(s)");
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
Strcpy(buf, tmp);
|
Strcpy(buf, tmp);
|
||||||
conditions_bitmask = str2conditionbitmask(buf);
|
conditions_bitmask = str2conditionbitmask(buf);
|
||||||
@@ -2199,7 +2205,7 @@ int sidx;
|
|||||||
if (k >= CLR_MAX)
|
if (k >= CLR_MAX)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
coloridx = k;
|
coloridx = k;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* set the bits in the appropriate member of the
|
/* set the bits in the appropriate member of the
|
||||||
condition array according to color chosen as index */
|
condition array according to color chosen as index */
|
||||||
@@ -2227,7 +2233,7 @@ clear_status_hilites()
|
|||||||
blstats[1][i].thresholds = blstats[0][i].thresholds;
|
blstats[1][i].thresholds = blstats[0][i].thresholds;
|
||||||
temp = next;
|
temp = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user