Pasi Kallinen [Thu, 26 Dec 2019 16:43:39 +0000 (18:43 +0200)]
Add lua object references
Whenever a lua script references a core struct obj, increment a counter
in the obj struct. Core code will not free the obj, if there are any
lua references pointing to it, just makes it free-floating.
When lua script ends, the lua gc will free the free-floating objects.
PatR [Tue, 24 Dec 2019 12:31:41 +0000 (04:31 -0800)]
fix github issue #272 - meat rings, +0 protection
Meat rings were causing increased hunger even though they don't do
anything. Not mentioned in the report, but cheap plastic imitation
amulets increased hunger too and they don't do anything either.
Trickier to fix, +0 rings of protection were excluded from hunger
on the grounds that +0 rings don't do anything, but since 3.6.0
+0 protection provides +1 to magic cancellation if protection isn't
coming from anywhere else. Two +0 rings of protection are trickier
still since only one of them provides the MC bonus.
PatR [Tue, 24 Dec 2019 11:26:34 +0000 (03:26 -0800)]
'w-' object lost panic
After the "make 'w' parallel with 'Q'" patch, wielding bare hands
was erroneously treating object id 0 as a split of zeroobj. That
isn't in inventory so seems 'lost'. Fixed by testing for nonzero.
There was another bug: you could wield a partial stack even if your
current weapon was cursed. Fixed by reordering if/else-if/end-if.
PatR [Tue, 24 Dec 2019 10:41:19 +0000 (02:41 -0800)]
fix github issue #268 - worm tooth & crysknife
Change the composition of worm tooth from none-of-the-above to bone
and crysknife from mineral to bone, same as is used for unicorn horn.
I think the only significant difference will be that worm teeth used
up during polypiling will produce skeletons rather than flesh golems.
nhmall [Mon, 23 Dec 2019 15:44:07 +0000 (10:44 -0500)]
add a requested interface adjustment for menu invert operations
Originally requested by one of the hardfought admins
Adjust all active window ports (tty, curses, win32, Qt, X11) to store
the itemflags that they receive with each item.
Also, make those active window ports understand the new
MENU_ITEMFLAGS_SKIPINVERT flag by skipping any menu items with that
setting during invert_all and invert_page operations.
Build testing and rudimentary functionality testing was carried out
on each of the window ports listed above.
The code was also modified on some non-active window ports (Qt3, gem,
gnome) but it was not tested for build or function there.
The desired functionality expressed was to be able to select a
single object category, and use the @ "invert all" function to
exclude that one and select all the others.
The "invert all" function's behavior of also including things
like "select all" and BUCX menu items made the feature unuseful
for that purpose.
PatR [Mon, 23 Dec 2019 10:26:59 +0000 (02:26 -0800)]
github issue #267 - giant {beetle,spider}
Increase weight of giant spider from 100 to 200; leave nutrition at 100.
Increase weight of giant beetle from 10 to 200; increase nutrition from
10 to 50. Both are still size 'large'.
I've left giant ant with weight 10, nutrition 10, size 'tiny' so that
it doesn't become bigger than soldier and fire ants.
PatR [Mon, 23 Dec 2019 01:22:07 +0000 (17:22 -0800)]
fix mysterious force bug
Subtracting one dungeon depth value from another had the subtraction
backwards and that yielded a negative value where a positive one is
expected. If NH_RELEASE_STATUS were to be set to NH_STATUS_RELEASED
then this was at risk of crashing (if the bad subtraction yields -2,
rn2(diff+2) would divide by 0) since rn2()'s argument isn't validated
for released version.
fixes37.0 was confused, listing a couple of things that aren't bugs
in 3.6 as general fixes. I suspect that the DLB one was fixed before
being exposed via git, so shouldn't be there at all.
nhmall [Sun, 22 Dec 2019 23:28:24 +0000 (18:28 -0500)]
groundwork for window port interface change to add_menu
groundwork only - window port interface change
This changes the last parameter for add_menu() from a boolean
to an unsigned int, to allow additional itemflags in future
beyond just the "preselected" that the original boolean offered.
There shouldn't be any functionality changes with this groundwork-only
change, and if there are it is unintentional and should be reported.
PatR [Sun, 22 Dec 2019 22:51:05 +0000 (14:51 -0800)]
wielding partial stack
If you're wielding a stack of N items, issuing the command to quiver
them asks whether you want to quiver N-1 of them (implicitly leaving
one wielded). If you answer no then you're asked whether to quiver
all of them. You could also give a count when picking the item to be
quivered and the stack would be split based on that.
However, if you have a stack of N items quivered, issuing the command
to wield them just did so, leaving the quiver empty. And picking an
item ignored any count, so even explicitly asking for 1 (out of N)
wielded the whole stack. Change 'w' to parallel 'Q'; if you try to
wield a quivered stack, you'll be asked whether to wield just 1 of
them. For no, ask whether to wield the whole stack. Or you can give
an explicit count when picking any stack in inventory to wield.
Both 'w' and 'Q' probably ought to handle the alternate/secondary
weapon similarly when it contains a stack. This doesn't address that.
PatR [Sun, 22 Dec 2019 21:40:59 +0000 (13:40 -0800)]
'quick_farsight' option
Bite the bullet and add a special purpose boolean option to control
game behavior for random clairvoyance. When objects or monsters are
discovered, it normally issues "you sense your surroundings" and
performs a getpos() operation which allows the player to browse the
map by moving the cursor around and getting 'autodescribe' feedback.
But there have been complaints that once the hero has the Amulet
(which triggers random clairvoyance even though hero isn't flagged
as having that attribute) the message and pause-to-browse become too
intrusive.
This was initially combined with the 'timed clairvoyance' fix because
they both bump EDITLEVEL to invalidate existing save files, but their
details don't interact so I separated them.
PatR [Sun, 22 Dec 2019 21:30:25 +0000 (13:30 -0800)]
fix github issue #266 - timed clairvoyance
When the hero has random clairvoyance, the code used
| (moves % 15) == 0 && rn2(2) != 0
(where 'moves' is actually the turn number) to decide when it would
kick in and show a portion of the map. If the hero was fast enough
to get an extra move when the turn value met the (moves % 15) == 0
condition then clairvoyance could happen twice (or more if poly'd)
on the same turn.
The changes (one new field, reordering a few others) in 'struct
context' invalidate existing 3.7.0-x save files.
PatR [Sun, 22 Dec 2019 00:57:53 +0000 (16:57 -0800)]
Unix Makefile.utl
Build feedback filtered by a script which filters out -Dthis -Wthat:
gcc -g -I../include -I../lib/lua-/src -c ../win/share/tilemap.c
The second -I is obsolete or else its bogus value would have caused
build failure. When removing it, I noticed that there was still quite
a bit of obsolete yacc and lex stuff in there. Remove that too.
PatR [Wed, 18 Dec 2019 03:08:26 +0000 (19:08 -0800)]
ceiling hiders vs '>'
Poly'd hero hiding on the ceiling was told "you can't go down here"
if using '>' at a spot that didn't have down stairs, trap door, hole,
or pit. Let '>' bring a ceiling hider out of hiding; lurker above
resumes flying, piercer falls to floor or whatever is underneath it.
PatR [Wed, 18 Dec 2019 02:14:08 +0000 (18:14 -0800)]
wizard mode wishing for terrain
Fix some issues noticed when experimenting with ceiling hiders.
They're all blind (at least without the monks' Eyes) and some of
the behavior while blind seemed to be incorrect (though some that
I thought was wrong turned out to be ok; feel_newsym() won't update
the map if the hero can't reach the floor). Fixing that made me
notice that some terrain side-effects (being underwater or stuck in
lava) weren't getting disabled when the underlying terrain wasn't
the corresponding type anymore.
nhmall [Tue, 17 Dec 2019 05:41:55 +0000 (00:41 -0500)]
allow run-from-removable-device configuration on Windows
Allow a way to configure NetHack to run entirely from a USB stick
or other removable device in a way that allows everything to
reside entirely on the USB stick, and nothing on the computer's
hard drive. That could be done in versions prior to 3.6.3.
Sample:
i: is a USB stick
i:\nhdist contains the NetHack Windows distribution and a sysconf
file dropped into that distribution with the following entry in it:
portable_device_top = nethack
No device is included in the portable_device_top entry, the device
is always the device that the nethack exe resides on. If you try
to specify a device in the portable_device_top path, the device
portion will be ignored.
portable_device_top specifies the folder on the device that is writable
by NetHack and as such it cannot be the same folder that the executable
resides in.
i:\nhdist\nethack --showpaths
Variable playground locations:
[hackdir ]="i:\nethack\"
[leveldir ]="i:\nethack\"
[savedir ]="i:\nethack\"
[bonesdir ]="i:\nethack\"
[datadir ]="i:\nhdist\"
[scoredir ]="i:\nethack\"
[lockdir ]="i:\nethack\"
[sysconfdir]="i:\nhdist\"
[configdir ]="i:\nethack\"
[troubledir]="i:\nethack\"
NetHack's system configuration file (in sysconfdir):
"i:\nhdist\sysconf"
The loadable symbols file (in sysconfdir):
"i:\nhdist\symbols"
Basic data files (in datadir) are collected inside:
"i:\nhdist\nhdat363"
No end-of-game disclosure file (disabled).
Writable folder for portable device config (sysconf portable_device_top):
"i:\nethack\"
Your personal configuration file (in configdir):
"i:\nethack\.nethackrc"
Without that sysconf file in the NetHack distribution folder on the
USB stick with the 'portable_device_top = ' entry, the paths
return to the default locations for 3.6.3 on Windows:
i:\nhdist\nethack --showpaths
Variable playground locations:
[hackdir ]="C:\Users\JaneDoe\NetHack\3.6\"
[leveldir ]="C:\Users\JaneDoe\AppData\Local\NetHack\3.6\"
[savedir ]="C:\Users\JaneDoe\AppData\Local\NetHack\3.6\"
[bonesdir ]="C:\ProgramData\NetHack\3.6\"
[datadir ]="i:\nhdist\"
[scoredir ]="C:\ProgramData\NetHack\3.6\"
[lockdir ]="C:\ProgramData\NetHack\3.6\"
[sysconfdir]="C:\ProgramData\NetHack\3.6\"
[configdir ]="C:\Users\JaneDoe\NetHack\"
[troubledir]="C:\Users\JaneDoe\NetHack\3.6\"
NetHack's system configuration file (in sysconfdir):
"C:\ProgramData\NetHack\3.6\sysconf"
The loadable symbols file (in sysconfdir):
"C:\ProgramData\NetHack\3.6\symbols"
Basic data files (in datadir) are collected inside:
"i:\nhdist\nhdat363"
No end-of-game disclosure file (disabled).
Your personal configuration file (in configdir):
"C:\Users\JaneDoe\NetHack\.nethackrc"
Patric Mueller [Sun, 15 Dec 2019 19:38:44 +0000 (20:38 +0100)]
Fix compilation on platforms that split the ncurses and tinfo libraries
Some platforms compile ncurses in such a way that the tinfo library needs to
be separately linked in (e.g. Gentoo).
The tinfo library is a low-level library being used by and bundled with
ncurses.
Adding '-ltinfo' to WINTTYLIB in the hint files was considered the most robust
solution to this problem. This still works on systems with ncurses 5.9.
Using pkg-config was ruled out as the default build of ncurses doesn't install
the necessary files.