Commit Graph

13584 Commits

Author SHA1 Message Date
nhmall
fc0bb9631a synchronize some recent changes between linux.370 and macOS.370 2022-06-03 21:26:21 -04:00
PatR
b4a415848d curses locale.h fix 2022-06-03 13:12:27 -07:00
PatR
4c47b7f622 'make depend' update 2022-06-03 13:02:40 -07:00
PatR
f5642d8bc4 fixes entry for PR #784 - reset just-picked-up
Pull request from entrez:  the just-picked-up flag on recently
picked up items was being reset when you stepped on other items
without picking anything else up.

Closes #784
2022-06-03 12:48:38 -07:00
Michael Meyer
fd3f50ebba Reset justpicked only when picking up items
With reset_justpicked called unconditionally near the top of pickup, it
was impossible to pick up some items, walk over to a chest, and use 'P'
to deposit the items with autopickup on: pickup is called with every
move, and autopickup allowed execution to reach the reset_justpicked
call whenever the hero stepped on a square with an item in it.  As a
result, stepping onto a square with a container would clear all the
justpicked flags in inventory (pressing ',' and then declining to pick
anything up would have a similar effect).

Instead, call reset_justpicked only when the hero (or autopickup) has
actually selected an item to pick up.  This makes the code a bit more
complicated than before -- I don't think there's a way to do it with
just one reset_justpicked call any more, due to the structure of pickup
and the need to call reset_justpicked before actually putting any items
into inventory -- but it means that justpicked info will be much less
ephemeral and more useful when managing stashes, etc.
2022-06-03 12:48:38 -07:00
nhmall
ff00c14893 wished-for doors in wizmode always vertical
Closes #788
2022-06-03 15:30:18 -04:00
nhmall
0039d332e7 Merge branch 'fix-doorwish-horizontal' of https://github.com/entrez/NetHack into pr788 2022-06-03 15:29:02 -04:00
Michael Meyer
092e8c37fd Fix: wished-for doors in wizmode always vertical
Wishing for a door is intended to retain the existing 'horizontal' value
of the surrounding wall or door (see comment in the wizterrainwish
'door' case).  However, the field was being reset by mistake, causing
all door wishes to create vertical doors.  Preserve it as intended.
2022-06-03 15:17:03 -04:00
PatR
4a7481dab6 github PR #787 - segfault for wizterrain wish
Pull request from entrez:  the change to show the result of a wish in
its gamelog/livelog event resulted in a segfault if that result was
&zeroobj.  It occurs for wizard mode wishes producing terrain changes
instead of objects.

Closes #787
2022-06-03 12:10:55 -07:00
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