nhmall [Wed, 4 Dec 2019 04:32:12 +0000 (23:32 -0500)]
fix self-recover prompting on windows
the prompting on Windows wasn't working correctly if a prior game had crashed
and the self-recover feature was trying to kick in. This impacts tty, curses,
and mswin (GUI).
PatR [Sun, 1 Dec 2019 04:19:10 +0000 (20:19 -0800)]
fix #H9479 - worn dented pot can't be taken off
Taking off no-delay helmets, gloves, and boots were unintentionally
taking off suit instead and stayed worn themselves. As far as I
saw, only helmet types "fedora" and "dented pot" were applicable;
all gloves and boots have a small multi-turn delay. This was an
unintended side-effect of the first "slippery gloves" commit so
happened about three weeks ago.
nhmall [Sat, 30 Nov 2019 16:44:07 +0000 (11:44 -0500)]
has_color() performance fixes
Performance profiling showed that multiple strcmpi() calls were
occurring each and every time a character was going to the map.
This update:
- honors the WC_COLOR capability
- It allows a window-port to control individual color availability should the window-port wish to do so.
- Makes checking on the individual colors for the active window-port is a straightforward table lookup at the CLR_ offset.
iflags.use_color remains a master on/off switch for use of color, regardless of the capability
compiled into the game (default TRUE).
The has_color() routine, which is now a shared routine in src/windows.c, could likely be made
into a simple macro to eliminate the function call, but this update does not go that far.
This hits a lot of port files due to the window-port interface change, mostly cookie-cutter.
nhmall [Sat, 30 Nov 2019 03:37:30 +0000 (22:37 -0500)]
insert Lua version
Instead of the hardcoded value that's in this right at the moment,
the intention is to get the Lua version information directly from
Lua itself for the insertion. For now, this will have to do.
PatR [Sat, 30 Nov 2019 02:31:45 +0000 (18:31 -0800)]
fix a memory leak
Memory allocated for a trap in getlev() wasn't being freed. There
is already one extra allocation which is supposed to get freed after
the loop, but the 'keepgoing' flag caused an extra trap allocation
before loop termination. So the unintentional one got freed but did
so by intercepting the free for the end-of-list one.
Fruit had similar code which applied to full game save and restore
rather than level save and restore so wasn't as noticeable.
PatR [Fri, 29 Nov 2019 19:38:42 +0000 (11:38 -0800)]
fix teetering typo
do.c:1005:54: warning: address of function 'uescaped_shaft' will always
evaluate to 'true' [-Wpointer-bool-conversion]
if (trap && (uteetering_at_seen_pit(trap) || uescaped_shaft)) {
~~ ^~~~~~~~~~~~~~
PatR [Thu, 28 Nov 2019 23:00:54 +0000 (15:00 -0800)]
3.7: goldX and other stuff
Move option variable goldX (True: treat gold as BUC unknown, False:
treat gold as uncursed during BUCX filtering) from iflags to flags
so that it persists across save/restore.
Get rid of a few obsolete things from struct flags.
Try to make the 'cursesgraphics' option work although I don't think
that it was ever functional enough for anybody to use so probably
could have been removed instead.
Bump EDITLEVEL; any current save files are invalid.
Demote status from Beta to Work-in-Progress.
I modified src/sfdata.c manually (not included here) to get a full
build. The Unix Makefile.src needs to be taught when and how to
regenerate it.
PatR [Thu, 28 Nov 2019 00:27:13 +0000 (16:27 -0800)]
paranoid_confirmation:eating
Add 'eating' (synonym 'continue') to the list of things that can be
set via paranoid_confirmation to require "yes" instead of "y" when
the user is prompted about something, in this case "Continue eating?".
dat/opthelp was missing a few of the paranoid_confirmation choices.
nhmall [Wed, 27 Nov 2019 22:19:55 +0000 (17:19 -0500)]
number pad changes from pull request #247
Below is the accompanying text from the pull request on
GitHub https://github.com/NetHack/NetHack/pull/247:
> This fixes the issue brought up in https://www.reddit.com/r/nethack/comments/dv3pae/curses_and_the_numberpad/?st=k3hgply6&sh=dbc2bf7d .
>
> I don't know why the "regular" (tty) method doesn't seem to work for him,
> but I'm going to chalk it up to a PDCurses oddity. What I do know, however,
> is that the alternate method I added a year ago or maybe longer, that allows
> numpad usage even with number_pad:0 (to retain the default keybindings in case
> an user is used to them, while keeping number pad behaviour making sense,
> similar to NetHack4+friends) was only partially implemented, for some reason.
> This adds the rest of the keys, meaning that this means of key interpretation
> should be more realible. KEY_A2/B1/B3/C2 are not standard keys in the Curses
> documentation, and is thus behind an ifdef -- but PDCurses, amongst other
> implementations, makes use of them.
>
> As a side effect, Home/End/PgUp/PgDn are now interpreted as diagonal movement,
> since some terminals interpret number_pad keys that way. I do not consider this
> a problem since they went unused in normal gameplay anyway (This does not
> interfere with menus or similar).
PatR [Wed, 27 Nov 2019 19:24:23 +0000 (11:24 -0800)]
fix part of #H9467 - clairvoyance vs sensed mons
When a monster is drawn on the map, remove any "remembered, unseen
monster" glyph being shown at the same spot. Clairvoyance shows
all monsters in vicinty, then ones which can't be seen are replaced
with the 'I' glyph (which is on the object layer or the display,
not the monster layer show is subject to different update behavior).
But subsequent monster refresh didn't get rid of it when a sensed
monster was displayed over it. (3.6.1 included a similar fix for
warned-of monsters.)
Also during clairvoyance, don't draw an 'I' at a spot that will
immediately be refreshed with a monster because 'I' clobbers any
remembered object at the same location.
Fix alternate number pad interpretation only working for diagonals
This fixes the issue brought up at https://www.reddit.com/r/nethack/comments/dv3pae/curses_and_the_numberpad/?st=k3hgply6&sh=dbc2bf7d .
I don't know why the "regular" (tty) method doesn't seem to work for him,
but I'm going to chalk it up to a PDCurses oddity. What I do know, however,
is that the alternate method I added a year ago or maybe longer, that allows
numpad usage even with number_pad:0 (to retain the default keybindings in case
an user is used to them, while keeping number pad behaviour making sense,
similar to NetHack4+friends) was only partially implemented, for some reason.
This adds the rest of the keys, meaning that this means of key interpretation
should be more realible. KEY_A2/B1/B3/C2 are not standard keys in the Curses
documentation, and is thus behind an ifdef -- but PDCurses, amongst other
implementations, makes use of them.
As a side effect, Home/End/PgUp/PgDn are now interpreted as diagonal movement,
since some terminals interpret number_pad keys that way. I do not consider this
a problem since they went unused in normal gameplay anyway (This does not
interfere with menus or similar).