Commit Graph

13555 Commits

Author SHA1 Message Date
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
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
copperwater
218a6a9d25 Have newcham() give messages when monsters polymorph in more cases
This is a descendent of an earlier patch I wrote. The main idea is still
to clearly communicate to the player *what* something is turning into,
without the need to farlook afterwards, and give them the opportunity to
add MSGTYPE for when something jumps on a polymorph trap and becomes an
arch-lich. If it happens out of sight, the player also might get a whiff
of the monster's smell, giving a bit of advance warning.

There is one new case in here, in normal_shape(), which came about
because I noticed a weird message sequence: "The magic-absorbing blade
cancels the python!  You kill the chameleon!" with no intervening
message indicating the python reverted to a chameleon.
2022-05-27 20:54:47 -04:00
PatR
01f3be9a7c couple of is_clinger bits
The grounded() macro wasn't fully handling is_clinger().  Not sure
what impact this fix will have.

Add ability to cling to the ceiling to enlightenment feedback.  If
it gets fixed up to a state where it is useable while polymorphed,
some or all of it should be moved to non-magic ^X feedback.
2022-05-27 15:28:49 -07:00
nhmall
5c1e22b337 Merge branch 'pr551' into NetHack-3.7 2022-05-27 16:43:00 -04:00
nhmall
39ecdd6075 writing type-named scrolls pr#551
entrez commented in https://github.com/NetHack/NetHack/pull/551 on Jul 16,
2021:
"When using a marker, it is possible to write a scroll based on the
 type-name assigned to it by the user. Somewhat unintuitively, this
 system broke down if the assigned name was identical to the real name of
 a scroll type: trying to write a scroll by its previously-assigned name
 'scare mon' or 'id' would be guaranteed to succeed, but this wouldn't be
 the case if the user-assigned name was 'scare monster' or 'identify'.

 Revise dowrite(write.c) to prefer a user-assigned type-name to the
 real name of a scroll that isn't already formally known, while
 continuing to prefer the real name of an identified scroll to both."

Closes #551 (Github pull request)

Also,
Closes #436 (Github issue)
2022-05-27 16:41:46 -04:00
nhmall
17fe18d18a Merge branch 'fix-write-named-scroll' of https://github.com/entrez/NetHack into pr551 2022-05-27 16:35:30 -04:00
nhmall
0aba9ff77e restrict a Windows console message to debug 2022-05-27 16:33:22 -04:00
nhmall
6ea2e8e222 Merge branch 'pr659' into NetHack-3.7 2022-05-27 16:16:49 -04:00
nhmall
4d212e9864 Merge branch 'homebrewed-curses' of https://github.com/perryprog/NetHack into pr659 2022-05-27 16:16:25 -04:00
nhmall
947d65a27d Merge branch 'pr773' into NetHack-3.7 2022-05-27 16:08:55 -04:00
nhmall
2af1acce8b mdisplacem stoning and gloves had test backwards
Closes #773
2022-05-27 16:07:27 -04:00
nhmall
0eabe97c4a Merge branch 'mdisplacem-stoning' of https://github.com/entrez/NetHack into pr773 2022-05-27 16:05:17 -04:00
Michael Meyer
4e3812b5e4 Fix: mdisplacem stoning and gloves
Apparently this is a bug that's existed since mon-vs-mon displacement
was introduced in 2003 (in 89c785e): if a monster displaced a footrice,
having gloves on would make it vulnerable to being stoned, while having
bare hands would protect it.  Switch it around so wearing gloves blocks
petrification, as it does under other circumstances.

Also add a message explaining why the displacing monster was stoned (if
the displacement attempt is visible to the hero), so the "Foo turns to
stone!" message has some context.
2022-05-27 15:58:12 -04:00
nhmall
3a1d49710c cron daily Guidebook.txt update 2022-05-27 11:39:34 -04:00
nhmall
d3ff89f5ec daily cron update to Files 2022-05-27 10:40:33 -04:00
nhmall
c414f3a648 manual bump of guidebook date to match last commit 2022-05-27 10:38:54 -04:00
PatR
e7923bafe9 github pull request #772 - displaying new glob
If a monster killed a pudding, the resulting glob was dropped on
the map but might now be shown depending upon interaction--or lack
of such--with nearby globs.

The commit also changed the indentation of a label; I've reversed
that.  Having labels always be indented one space means there's
no need to look into nested blocks to find them.  But having no
indentation at all interferes with GNU diff (which is used for git
diff) showing the function that a band of changes occurs in (done
by augmenting the change bars in front of the band).  That is based
on the most recent preceding line having a letter in the leftmost
column.  Back when we had K&R-style function definitions which
didn't indent their arguments, that diff feature wasn't useful.
But after switching to ANSI-style definitions it is--except when an
unindented label interferes.
2022-05-25 12:38:07 -07:00
Michael Meyer
66c70eb453 Fix: invisible pudding globs
When a pudding was killed by a monster (player-caused deaths were exempt
because of a 'backup' newsym call in xkilled), and the resulting glob
ended up on the pudding's square (whether because there were no adjacent
globs, or because the adjacent glob merged into the new one rather than
vice-versa), the glob wouldn't be drawn onto the map until the squre was
redrawn with ^R or similar.  This was because the early return for globs
in make_corpse skipped the typical newsym call near the end of the
function.

In this commit I just added a newsym call to the glob case in
make_corpse, but adding a newsym call to monkilled as a guard against
similar cases (equivalent to the one in xkilled) seems like a possible
extension.  I wasn't sure if there's a particular reason it's not
included in monkilled, so I didn't mess with it.
2022-05-25 12:34:59 -07:00
PatR
8a092aef0e timer code readability
Something else noticed while looking for something unrelated.  The
original code is correct but I think the revised code is a little
easier to take in when looking at it.
2022-05-25 12:30:48 -07:00
PatR
a021424af8 maybe_finished_meal() comment bit
An end of line comment that spans multiple lines needs to start the
continuation line(s) with '*' or clang-format will convert it into
a block comment that follows the initial line.

  foo(); /* call foo
            but not bar */
would become
  foo();
  /*
   * call foo but not bar
   */
however
  foo(); /* call foo
          * but not bar */
would stay as-is.

All that for a one-line change, and then I've changed this particular
instance to be
  /* call foo but not bar */
  foo();

There are lots of these that should eventually be fixed.  I just
happened to notice this one when looking for something else.
2022-05-25 12:20:48 -07:00
PatR
f592b9dfdb zap_over_floor comment typo 2022-05-23 18:34:09 -07:00