Commit Graph

13575 Commits

Author SHA1 Message Date
Michael Meyer
fd55dfba1f Fix: segfault on wizmode terrain wish
The new livelogging of wish results caused a segfault when attempting to
handle the results of a wizard mode terrain wish, since a successful
terrain wish returns a nonzero obj which nonetheless is just a dummy
object.  Move the existing check for that further up to skip all the
livelogging stuff entirely, since such wishes will never happen in a
real game and exist purely for debugging purposes.
2022-06-03 14:53:57 -04:00
nhmall
dca1cd7526 alter wording in last commit fixes entry 2022-06-02 19:24:52 -04:00
nhmall
6fbc8ccf0f spelling in last fixes message 2022-06-02 19:22:18 -04:00
nhmall
516df172d0 fix message when monster's two-handed weapon welds
K3610 reported to devteam:
When you see a monster wield a cursed two-handed weapon,
the weapon "welds itself to the foo's hand" instead of its "hands."

Observed on hill orcs wielding a cursed two-handed sword.
2022-06-02 19:20:21 -04:00
PatR
afbb7e2827 fix #K3603 - multiple stacks of gold in container
When taking stuff out of a container, specifying a subset count for
an item and getting the pickup_burden prompt, answering 'q' undid the
subset split but answering 'n' did not.  If the item in question was
a stack of gold, the container would end up with two stacks.  That
action could be repeated as long as any of the stacks was big enough
to trigger pickup_burden confirmation so an arbitrary number of gold
stacks could be produced.  (Eventually they would be too small for a
subset to cause an increase in encumbrance, or possibly all reduced
to just one gold piece, then no more stacks could be created.)

Situation occurred for all menustyles; traditional and via-menu needed
separate fixes.  It didn't occur for pickup off the floor.

Report was for 3.6.6 but the bug was still present in dev version.
2022-06-02 14:44:30 -07:00
nhmall
57cfd7e7ed another ncursesw follow-up 2022-06-02 17:14:42 -04:00
nhmall
168ee4c9a8 yet another follow-up for linux.370 ncursesw 2022-06-02 16:31:30 -04:00
PatR
cc2332946e fix #K3608 - glob quantity
Wishing for "N <size> globs [of pudding type]" produces 1 glob
starting at <size> and then multiples weight by N (so possibly
increasing <size>).  When not it wizard mode, N can be replaced by
a random amount to prevent the total weight from being huge.  When
N was less than 6, it was possible for that random amount to be
larger than what the player asked for.

Change the way the random amount is calculated so that it won't
ever be larger than what player specified.  Also for wizard mode
prompt whether to make the substitution so that the player can
choose to abide by the limit or to obtain a huge glob for whatever
testing is being conducted.
2022-06-02 13:02:45 -07:00
nhmall
7b1528707b another follow-up for ncursesw and CURSES_UNICODE
Don't define CURSES_UNICODE without ncursesw being available
2022-06-02 15:26:48 -04:00
nhmall
ae1f5b8d2a follow-up on linux.370 ncursesw 2022-06-02 15:10:15 -04:00
nhmall
62014be6f8 use ncursesw on linux for curses support of enhanced1 2022-06-02 14:43:46 -04:00
PatR
e764026a1f more wish logging - show the result
Extend the log event for a wish to include what was produced.  It
would be better to show the item as fully ID'd but then #chronicle
gives away information.

The backslash+newline pairs were inserted for this log message.  In
the game and in dumplog those two lines are each one wide line.  The
turn numbers shown are actually arbitrary since ^W takes no time.

|Logged events:
| Turn
|    1: wizard the chaotic male orcish Wizard entered the dungeon
|    2: made his first wish - "protection", got "a tattered cape"
|    3: made his first artifact wish - "blessed +2 rustproof magicbane",\
 got "an athame named Magicbane"
|    4: wished for "master key of thievery", got "a key named The Master\
 Key of Thievery"
2022-06-02 07:51:54 -07:00
PatR
c413233a4f pull request #768 - log declined wish or genocide
Pull request from vultur-cadens:  if a wish is declined by asking
for "nothing" or "none" or "nil", log that for gamelog/livelog as a
declined wish.  Likewise when specifying monster species or class to
genocide as "none" or "nothing" or ESC, log it as declined genocide.

Closes #768
2022-06-02 06:58:19 -07:00
vultur-cadens
53f782dcd6 Livelog declined wishes and (non-cursed) genocides 2022-06-02 06:57:53 -07:00
nhmall
8848a81990 restrict stunning effect to is_xport trap types
The issue first arose in commit 6a65b412.
Reported to devteam via email by entrez.
2022-06-02 09:41:47 -04:00
PatR
5977fa4481 another lua warning bit
I forgot to do this with yesterday's post garbage collection fix
update.  Record lua warnings in paniclog during normal play too, not
just when in wizard mode.
2022-06-01 13:45:57 -07:00
nhkeni
6c2b02aa8c clarify fixes entry 2022-06-01 14:02:13 -04:00
nhmall
3495d99bc4 Merge branch 'pr782' into NetHack-3.7 2022-06-01 12:41:26 -04:00
nhmall
1b8cadba2b Merge branch 'fix-splev' of https://github.com/argrath/NetHack into pr782 2022-06-01 12:41:00 -04:00
nhmall
db86ebd9e7 fixes3-7-0.txt update for pull request 782 2022-06-01 12:40:17 -04:00
nhmall
caeac77239 bear trap vanishes when poly'd hero fails to eat
Closes #781
2022-06-01 12:31:32 -04:00
SHIRAKATA Kentaro
4faf79dccc fix memory leaks related to selection_new()
selection_new() returns an address of malloc()'ed buffer.
If ov is null, this value is discarded without freeing the buffer.
To avoid this, move null-checks before calling selection_new().

Also, remove null-check of the return value of selection_new()
because it always returns non-null.
2022-06-01 21:38:51 +09:00
PatR
18639d2ef2 send lua warnings to paniclog instead to player
Now that the garbage collection problem has been fixed, record lua
warnings in the paniclog file rather than showing them on the screen.

Move nhl_warn()'s warnbuf[] to struct g in case restart ever gets
implemented so that it can be cleared if the restart occurred while
a warning message was under construction.
2022-06-01 01:03:11 -07:00
PatR
e7080a6183 paniclog fix
Writing lua warnings to paniclog (coming soon; tested without the
garbage collection fix in order to have test data) could crash on
the last pair.  Those are written after the 'nomakedefs' structure
had been freed so version_string was Null.

The NAO PANICLOG_FMT2 code triggered a warning about the test for
g.plname; it is array so will never be Null.
2022-06-01 00:37:52 -07:00
nhmall
ae6a622c2b fixes entry 2022-05-31 21:56:40 -04:00
Rebecca Kelly
78658e9609 patch from ToxicFrog 2022-05-31 19:09:52 -04:00
PatR
42981361d7 another re_alloc() bit
realloc(NULL, size) is legitimate usage and nhrealloc() shouldn't
log a "<  0x00000000 __FILE__ __LINE__" entry for it.  heaputil
would complain about freeing Null.
2022-05-31 10:36:12 -07:00
PatR
af497bfb25 fix up a couple of realloc comments 2022-05-31 06:10:22 -07:00
nhmall
7d186332ae attempt to autodetect homebrew and macports
If homebrew is detected, and if the homebrew ncurses package
is installed, the set things up to use it.

Hopefully, this works okay for everyone right away, but it may need
some tweaking.
2022-05-31 08:17:29 -04:00
PatR
687e7c12f7 implement realloc() for MONITOR_HEAP or vice versa
Add new routine 're_alloc()' that functions as MONITOR_HEAP-aware
libc realloc().  'nhrealloc()' is the version that passes source
file and line info if built with MONITOR_HEAP enabled.  The heaplog
data might now contain '<' (freed by realloc), '>' (replacement
allocation by realloc), and '*' (resized by realloc) entries in
addition to the previous '+' (allocated) and '-' (freed) entries.
heaputil has already been updated in the NHinternal repository.

Move FITSint_() and FITSuint_() from hacklib.c to alloc.c so that
they can be accessed by miscellaneous utility programs.

Remove three or four copies of FITSint_() that were duplicated in
utility programs like dlb and tile2bmp due to those not having
access to src/hacklib.o.  They do have access to src/alloc.o (and
util/panic.o).
2022-05-30 23:19:35 -07:00
nhmall
4a8deefaa3 replace leading tabs in several more files 2022-05-30 12:38:22 -04:00
nhmall
a8f0e91ddf replace leading tabs in several files 2022-05-30 12:09:35 -04:00
nhmall
81cff2390f typo fix in fixes 2022-05-28 20:39:09 -04:00
PatR
48060dbebb pull request #774 - 'just-picked' pseudo obj class
Pull request from entrez:  fixes the combination of A and P for
menustyle:Full.  For menustyle:Traditional, it fixes selecting P for
putting stuff into a container.  Using P for multi-drop (D) already
worked and I haven't tried to figure out why the two commands behave
differently with just-picked.

Closes #774
2022-05-28 16:56:26 -07:00
Michael Meyer
991e739af4 Fix: loot regression, auto-select with justpicked
When using 'A'/autopick with the 'items you just picked up' category,
instead of autoselecting all items within that category, it selected
every item in your inventory (like it used to work before 3.7).  Just
blew up a bag of holding because of this.

While testing the fix for that, I noticed 'P' wasn't working at all
with menustyle:traditional -- you could select it as a filter, but it
didn't actually get applied to anything, so it would end up prompting
you for every item in inventory.  Fix both those things.
2022-05-28 16:56:25 -07:00
nhmall
16c2c3b32f update fixes3-7-0.txt for newcham() changes 2022-05-28 19:48:13 -04:00
nhmall
0ce9d3a1e9 Merge branch 'pr775' into NetHack-3.7 2022-05-28 19:42:21 -04:00
nhmall
9e6ac144b4 switch to using a flag parameter on newcham() 2022-05-28 19:35:48 -04:00
nhmall
67f80848bd Merge branch 'cancel-revert-msg' of https://github.com/copperwater/NetHack into pr775 2022-05-28 19:33:11 -04:00
PatR
ef9d874c22 more PR #771 - blast vs spell
Add the patch from entrez to describe the tower of flame effect from
a scroll of fire as "the blast" rather than "your spell" if it reveals
a secret door.
2022-05-28 14:09:31 -07:00
PatR
07a2ba6b54 display lua warnings instead of ignoring them
This will be an annoyance for wizard mode until someone actually
figures out and fixes the problem.  The complaints from lua during
garbage collection aren't new, they were just being ignored before.
2022-05-28 12:49:08 -07:00
PatR
3c402fb312 lua sandbox code reformatting
Remove a ton of tabs in nhlua.c and add missing whitespace to a bunch
of 'if(test){' lines and to a few casts.

Also simplify? obj handling during garbage collection (does not fix
the current gc problem) in nhlobj.c.
2022-05-28 12:35:44 -07:00
nhmall
5622a4a848 Merge branch 'pr776' into NetHack-3.7 2022-05-28 13:53:31 -04:00
nhmall
3a23f57ddd Merge branch 'little-fixups' of https://github.com/copperwater/NetHack into pr776 2022-05-28 13:53:12 -04:00
copperwater
a1258f898b Remove unused "mazeflag" parameter from mkfount()
This parameter appears to have been in the code for a very long time,
but never used, since no version of NetHack I can find had mazes with
randomly placed fountains in them. Certainly isn't used now, so this can
be reduced to the same call to find_okay_roompos used by similar
functions such as mksink.
2022-05-28 10:42:14 -04:00
copperwater
84f4e53fde Use RANDOM_CLASS instead of magic number 0 for mksobj_at() 2022-05-27 21:42:25 -04:00
copperwater
5529a9af45 Correction and clarification for "balk" math comment
Andrio pointed out at some point that the "below 25% HP: pet will not
attack at all" mentioned in this comment was wrong. It will not attack
*peaceful monsters* at all, but will still attack hostile monsters.

Also, the math behind the balk variable has confused several people,
thinking it's off by one and allowing the pet to attack one level higher
than stated. This is not the case, since it's the lowest level they
*won't* attack. Clarify that.
2022-05-27 21:35:05 -04:00
copperwater
9fa57cede7 Fix a stray magic number in pick_lock 2022-05-27 21:26:58 -04:00
copperwater
8e19d6628a Use looted rather than doormask when it pertains to a throne
They're both just aliases for rm.flags, but "doormask" doesn't mean
anything conceptual for a throne.
2022-05-27 21:25:18 -04:00
copperwater
1a847d0314 Remove pointless lighting statement in Val-strt
The whole level was already lit up, so lighting up a smaller area of it
does nothing.
2022-05-27 21:23:31 -04:00