PatR [Sat, 19 May 2018 18:47:15 +0000 (11:47 -0700)]
fix #H7159 - orc hero can start with lembas wafers
Orc heroes get an extra food item ("to compensate for generally
inferior equipment") and it could randomly be lembas wafers (or
cram rations), and Ranger heroes always started with cram rations
even when they're orcs. Fixing the latter was simple, but the
normal race-based substitutions weren't applied to randomly
generated items, so the fix for the former required a bit of code
reorganization in ini_inv().
Elf heroes already get lembas instead of cram; do the reverse for
dwarves (although I don't think this case can happen--no role gets
lembas wafers and only orcs and always-human tourists get random
food); give orc heroes tripe instead of either lembas or cram.
PatR [Sat, 19 May 2018 11:19:18 +0000 (04:19 -0700)]
fix some of #H7156 - perm_invent issues
> [1. perm_invent is kept in flags so persists across save/restore, but
> perm_invent capability can change if player restores with a different
> interface--or same one running on a different-sized display--so it
> ought to be in iflags instead.]
Not addressed here.
> 2. perm_invent window does not get updated when charging a wand (or
> other chargeable item presumably), with a scroll of charging.
Most scrolls rely on useup() -> update_inventory(), but charging uses up
the scroll early so that it will be gone from inventory when choosing an
item to charge. It needed an explicit update_inventory() after charging.
> 3. update_inventory(), is called from setworn(), which is called from
> dorestore(), when loading a save. Segfaults have been observed in
> variants based on this code (though not yet in vanilla 3.6.1), so it's
> possible this may be unsafe. The update_inventory() call in setworn()
> could be protected with "if (!restoring) ..."
tty doesn't support perm_invent, so this might be a win32 issue.
I've made the suggested change, but a better fix would be to turn off
perm_invent as soon as options processing (new game) or options restore
(old game unless/until #1 gets changed) has finished setting things up,
then turn it back on at the end of moveloop()'s prolog when play is
about to start.
= =
Most of the read.c change is reordering prototypes to match the order
of the corresponding functions. I did this when adding a new static
routine, then ended up discarding that routine.
PatR [Fri, 18 May 2018 23:57:44 +0000 (16:57 -0700)]
commit test for renamed branch
Locally I've committed to NetHack-3.6.0 and haven't yet pulled from
upstream to get the branch rename. I expect this commit to be
rejected but it could conceivably go through to the new name.
PatR [Thu, 17 May 2018 22:48:09 +0000 (15:48 -0700)]
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.
PatR [Wed, 16 May 2018 00:09:47 +0000 (17:09 -0700)]
tty/wintty.c w/o TEXTCOLOR
With TEXTCOLOR disabled, compiler warnings about term_start_color()
and term_end_color() not being declared were followed by link failure
because they weren't available.
This tries to simplify color handling in the tty status code without
resorting to #if TEXTCOLOR (the proper fix, but somewhat intrusive).
For the usual case where TEXTCOLOR is defined, there were instances
of
if (color != NO_COLOR && color != CLR_MAX)
term_start_color();
...
if (color != NO_COLOR)
term_end_color();
and also of
if (color != NO_COLOR)
term_start_color();
...
if (color != NO_COLOR)
term_end_color();
I've changed both types to be
if (color != NO_COLOR && color != CLR_MAX)
term_start_color();
...
if (color != NO_COLOR && color != CLR_MAX)
term_end_color();
so that start/end pairing will always be consistent.
Also, ((color_and_attr & 0xFF00) >> 8) might not work as intended if
using 16-bit int and color_and_attr happened to have its sign bit set.
Change to ((color_and_attr >> 8) & 0x00FF) to ensure just the desired
bits.
PatR [Tue, 15 May 2018 11:16:40 +0000 (04:16 -0700)]
tty status
Started by removing two or three unused variables, ended up cleaning
up a lot of formatting (tabs, trailing spaces, indentation, a few
wide lines, 'if (test) return' on same line). Marked some static
functions as static in their definitions instead of leaving it hidden
in their prototypes. Moved a pair of short-circuit checks to skip
several initializations.
Bart House [Mon, 14 May 2018 03:46:43 +0000 (20:46 -0700)]
Additional changes to xputc_core() and early_raw_print() to manage
the cursor position correctly. This is needed to handle raw printing
correctly. Added check for when we might be running off the bottom
of the screen when handling msmsg(). Added runtime checks to keep
cursor always within bounds.
PatR [Sat, 12 May 2018 08:05:29 +0000 (01:05 -0700)]
fix #H7140 - list MSGTYPE values shows empty strings
The 'O' menu's 'list' for MSGTYPE settings showed truncated versions
of really long message strings but didn't show anything except the
hide/stop/norep setting for ordinary length ones. 3.6.0 showed the
latter correctly but suffered buffer overflow for the former; the
fix for that had a typo/thinko in it.
Bart House [Sun, 13 May 2018 01:06:23 +0000 (18:06 -0700)]
Fix for bug 324 (aka H4216). We now will use nhraykey by default if the
players keyboard layout is non-english. nhraykey properly handles
non-english input. We also now support changing altkeyhandler in game.
Bart House [Tue, 8 May 2018 14:25:24 +0000 (07:25 -0700)]
Fix for bug H7132.
In nethackw, there can be conflicts between menu accelerators and an extra
choice accelerator. For example, when engraving the using fingers options
conflicts with the unselect all menu accelerator. The extra choice
accelerator should take precedence.
Bart House [Sun, 6 May 2018 08:13:30 +0000 (01:13 -0700)]
Implemented a fix to the lag problems that are occuring with the Win32
console port. The fix implements a console back buffer which
significantly reduces the number of calls made to WriteConsoleOutputXXX
and eliminates the lag users have been experiencing.
Bart House [Sun, 6 May 2018 08:13:30 +0000 (01:13 -0700)]
Implemented a fix to the lag problems that are occuring with the Win32
console port. The fix implements a console back buffer which
significantly reduces the number of calls made to WriteConsoleOutputXXX
and eliminates the lag users have been experiencing.
Specify both width and height when creating font for width testing
From Bart...
When we are creating the console font for testing character widths,
we were not specifying width. Because of this, the created font's
average width might be larger then what we expect and we might
falsely detect that the font was inappropriate for playing Nethack.
Fix provides the width that we are expecting when creating the font.
default to using latest SDK available on build machine
From Bart...
Modified build configuration to use latest SDK available by default.
This change will eliminate the need for us to hard code an SDK
version into our configuration file and will eliminate the need
for developers to set the SDK version when they do not have the
matching SDK version installed. Updated the Install.nt file removing
the mention of having to set the SDK version.
Noticed while testing the fix for the recently reported clairvoyance
bug. I saw a '1' move onto an 'I', then when it moved again the 'I'
reappeared. The remembered unseen monster couldn't be there anymore
if the warned-of monster was able to walk through that spot, so
remove any 'I' when showing a warning (digit) to stop remembering an
unseen monster at the warning spot.
Nobody has ever reported this so fixing it isn't urgent, but fixing
it is trivial so I'm doing it in now (without the clairvoyance fix).