Commit Graph

10428 Commits

Author SHA1 Message Date
nhmall
cc61ac61a4 README bit 2020-03-06 11:00:51 -05:00
nhmall
2af37f44d4 Merge March 2020 changes into NetHack 3.7 2020-03-06 10:59:50 -05:00
nhmall
e20024e42b March 2020 updates 2020-03-06 10:31:51 -05:00
PatR
32b69f5c33 avoid #wizrumorcheck crash on bad rumor input
If either rumors.tru or rumors.fal was empty when makedefs made
'rumors', init_rumors() will set true_rumor_size to -1 to indicate
that rumors aren't available.  It also closes the input file, and
then #wizrumorcheck closed that again, triggering a crash in the
dlb code.

Fortune cookies and oracles work ok (just not very interesting)
when rumors aren't available.  Only the check command had trouble
with that.
2020-03-05 13:55:45 -08:00
nhmall
998893ac32 fixes update 2020-03-04 16:01:50 -05:00
PatR
60bc28154a fix github issue #302 - divide by 0 crash
The traceback points directly to the problem:  divide by 0 happens
if the 'bogusmon' file only contains the "do not edit" line, which
would happen if 'bogusmon.txt' is empty.  makedefs probably ought to
complain about that.

There is now one hardcoded bogus monster to fall back to:  'bogon'.

Random tombstone epitaphs report divide by 0 if their text source is
empty, but it is done by rn2() rather than rn2_for_display_rng() so
is just a warning for pre-release code.  It would crash for release
version though.

I tried placing an empty engravings file and expected similar results
but didn't see any response.  Not sure what that means.

After the fix, empty epitaph file yields blank result so graves that
want a random epitaph won't have any epitaph.

Fixes #302
2020-03-04 15:57:33 -05:00
PatR
7220c9d2d2 more #302 - empty {bogusmon,engrave,epitaph}.txt
Have makedefs add a real data line to the output for the files that
caused trouble when empty.
2020-03-04 15:45:10 -05:00
Pasi Kallinen
54ca0c2211 Lua tests for map and room contents 2020-03-04 22:07:10 +02:00
Pasi Kallinen
a6dfbfca2f Lua: Add contents function to room and map
The function will get the map/room width and height as a parameter.
2020-03-04 20:05:15 +02:00
nhw_cron
0016132ab3 This is cron-daily v1-Jan-20-2020. files updated: Files 2020-03-04 11:43:28 -05:00
nhw_cron
b709869f13 This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2020-03-04 11:43:14 -05:00
nhmall
abdd3254ae updates for 3.6 March 2020 2020-03-04 10:41:57 -05:00
nhmall
1e5fd608bf update to Install.nt 2020-03-04 10:31:48 -05:00
PatR
12c2f84f64 corpse_xname() fix
Potential write out of bounds, in front of the block of obufs.
Not exploitable but could conceivably trigger a crash.
2020-03-04 01:58:22 -08:00
PatR
cb18f60331 match_str2clr() fix
Integrity fix.  Make sure color values obtained via atoi() are sane
so that use as array indices can't go out of bounds.
2020-03-03 16:46:04 -08:00
nhmall
7902bacf70 build fix for vs2019
src\nhlsel.c(604) : error C4703: potentially uninitialized local pointer variable 'mf' used
2020-03-03 18:34:27 -05:00
PatR
452962aa72 reglyph_darkroom map traversal 2020-03-02 16:33:43 -08:00
PatR
4b78763d70 Mister Fantastic's sea monster form
While polymorphed and underwater, an eel bite killed the hero who
rehumaized and crawled out of the water, then the eel continued with
its second attack and "wrapped itself around you" even though no
longer adjacent.  That's a long reach....

| ...@.
| .;}..
| .}}..

Make any additional attacks silently miss if hero changes location
during the attack sequence of a monster who has pinpointed the hero.
2020-03-02 15:58:42 -08:00
PatR
661570f7a9 conditional status condition tracking
If 'sinking-into-lava' is disabled as a displayed status condition
but general 'trapped' is enabled, then display 'trapped' when in lava.
Similarly, if 'grabbed-by-eel' is disabled but more general 'held' is
enabled, display 'held' when grabbed.
2020-03-02 15:16:50 -08:00
PatR
991dbc5b8f panictrace_libc
Try to make the tracebacks generated via PANICTRACE's libc method
be more readable.  There tends to be a lot of blank space in the
middle of lines, depending on the length of the program's or
libraries' file names, which can make lines wrap and the whole
thing sometimes be harder to make out.  Narrow it by squeezing out
some spaces from each line before writing to reduce the chance of
line wrapping.  That isn't guaranteed to make things ledgible but
seems to help quite a bit.  Also, force the line number inserted
by nethack to be two digits so when spanning from line 9 to line 10
it doesn't cause the field positions to shift by a column.  (Using
'#panic' doesn't have enough stack frames to illustrate that.)

I think the original libc formatting was designed for the address
column to hold a 32-bit value ('0x' prefix and 8 hex digits), and
eventually extending that to handle 64 bits ('0x' prefix and 16 hex
digits) made things wider than intended.  But the gradual increase
in the length of function names we use is also a factor.
2020-03-02 15:05:06 -08:00
Pasi Kallinen
00be8be45a Start of lua api docs
... in asciidoc format. Use "asciidoctor -b html5 lua.adoc"
to generate the HTML version.
2020-03-02 18:10:35 +02:00
Pasi Kallinen
c9b21e36a7 Add lua selection match method
Also improve the replace_terrain command parameters.
2020-03-02 16:17:53 +02:00
nhmall
ee2821e7e8 action after parse_role_opts() returns FALSE
The old parseoptions() would get a FALSE return from parse_role_opts() and
then exit FALSE.

The new parseoptions() was printing an error message due to the FALSE return
value, and then exiting FALSE.

Have it behave the original way following parse_role_opts().
2020-03-02 01:11:51 -05:00
PatR
ffcd471ef7 fix github issue #309 - random role segfault
Role selection is insanely complex.  I had to use a debugger to force
the relevant routine to be executed.

The analysis was correct:  it could use rn2(14) to pick a role (valid
values 0 through 12) and randomly getting 13 would lead to a crash.

The terminating element of roles[] passes all the ok_role(), ok_race(),
etc tests.  Explicitly exclude that element when collecting the roles
to choose from.
2020-03-01 14:36:28 -08:00
nhmall
0f3719d15e typos in doc/options.doc 2020-03-01 11:04:02 -05:00
nhmall
058fbc1cd5 more duplicate detect; also copy-and-paste for vt_tiledata entry left it enabled by default 2020-03-01 10:48:46 -05:00
PatR
99035e72ee throw-and-return vs !fixinv
Implement the request that a wielded+thrown aklys be given the same
inventory letter when it returns and is caught and rewielded, even for
the !fixinv setting where inventory letters don't stick.  Works for
Valkyrie-thrown Mjollnir and returning (ie, didn't hit) boomerangs as
well as for aklys.

I'm not sure how useful this really is, because on the rare occasions
that it either doesn't return or fails to be caught, it won't be given
the same letter when subsequently picked up.  So the player who relies
on it will still be vulnerable to using the wrong letter next time a
throw is attempted.  But at least picking it up explicitly displays
the new inventory letter, unlike catching it upon return.
2020-03-01 06:46:37 -08:00
Pasi Kallinen
297863d4bc Fix room tests 2020-03-01 10:28:19 +02:00
Pasi Kallinen
ce3b45944b Fix Fort Ludios room type
... and add an impossible when lua tries to create unknown room type.
2020-03-01 10:13:53 +02:00
PatR
95385cfc40 hard quit vs botl
For
 Really quit? [yn] y
 Dump core? [ynq] q
skip the final status update.  Noticeable when debugging and some
status breakpoints are set.
2020-02-29 16:44:48 -08:00
nhmall
16e5b27054 Merge 2020-02-29 18:49:16 -05:00
nhmall
2f1be94bfa since sole argument to set_duplicate_opt_detection was unused, eliminate it altogether 2020-02-29 18:47:34 -05:00
nhmall
c4b5d2f54b some warnings 2020-02-29 18:36:03 -05:00
nhmall
5d310d815d options follow-up: fix up duplicate_option_detection and !pet 2020-02-29 17:54:41 -05:00
nhmall
cca2bcaa84 minor flavor bit of the day 2020-02-29 13:57:31 -05:00
PatR
ae27942cd6 haste timeout, vomit countdown feedback
Change a couple of messages.  When speed/haste-self times out:
"you feel yourself slowing down" -> "you feel yourself slow down"
because the former was too close to the turn-to-stone countdown and
the loss of speed is immediate rather than gradual.

The vomiting countdown causes confusion and stun; vary the messages
for those if already confused or stunned:
"you feel slightly confused" -> "you feel slightly more confused";
"you can't seem to think straight" -> "you can't think straight".
2020-02-28 13:30:59 -08:00
Pasi Kallinen
22528d31f5 Allow coord in place of x and y in special level lua script 2020-02-28 22:14:36 +02:00
PatR
ab66475f21 X11/winstat.c formatting
Separate out the reformatting from other changes I'm working on
for X11 "fancy status".  Splits a few wide lines but mostly just
switches to the X11 idiom of combining
 XSetArg(arglist[argcount], ...);
 argcount++;
onto one line:
 XSetArg(arglist[argcount], ...); argcount++;
2020-02-27 11:51:10 -08:00
PatR
be50da07d9 botl update for trapped/untrapped
Make set_utrap() set context.botl when changing between untrapped and
trapped or vice versa.
2020-02-27 02:26:57 -08:00
nhmall
74b7ca1ad9 update a parameter in some ancient platforms 2020-02-26 21:53:07 -05:00
nhmall
3c95cba526 fix build break when there's no #define for CLIPPING 2020-02-26 21:38:38 -05:00
nhw_cron
5e3e20835b This is cron-daily v1-Jan-20-2020. files updated: Files 2020-02-26 19:48:25 -05:00
nhmall
9f01b33d9f fixes entry
This issue was present prior to the options overhaul; a fix
was embedded in the options overhaul code changes
2020-02-26 15:45:04 -05:00
nhmall
e05a6d411d Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-02-26 15:36:53 -05:00
nhmall
21ae547dec typo in fixes 2020-02-26 15:30:10 -05:00
PatR
bc0112bef7 showscore typo 2020-02-26 12:28:33 -08:00
nhmall
5f430f8105 fix warning observed on Mac OS X 2020-02-26 15:20:08 -05:00
nhmall
d609314d64 transpose error in comments bit 2020-02-26 15:03:58 -05:00
nhmall
1115402c14 Merge branch 'options-overhaul' into NetHack-3.7 2020-02-26 14:36:20 -05:00
nhmall
64e3cd72a4 fixes37.0 update for options overhaul 2020-02-26 14:32:07 -05:00