Commit Graph

16269 Commits

Author SHA1 Message Date
nhmall
3e1eeced1a CI update - take 4 2024-01-05 08:15:37 -05:00
nhmall
2b3938e45b CI update - take 3 2024-01-05 07:57:04 -05:00
nhmall
9cc5f54e96 CI update - take 2 2024-01-05 07:34:41 -05:00
nhmall
9b87881f0e update some builds in CI
- attempt build using ncurses6
- attempt build using qt6
2024-01-05 06:59:19 -05:00
nhmall
c3ffc284ad uudecode follow-up 2024-01-05 06:25:47 -05:00
nhmall
4e19221e55 variable 'display' causes shadow variable warnings in X11 build
display.botl      -> disp.botl
display.botlx     -> disp.botlx
display.time_botl -> disp.time_botl
2024-01-05 05:58:51 -05:00
nhmall
f8230eff4b quiet compiler warnings building sys/share/uudecode.c 2024-01-05 00:33:47 -05:00
nhmall
49a5d043c0 consistent use of TRUE vs 1 with botl and botlx 2024-01-04 23:48:38 -05:00
nhmall
22e52ee905 bundle the display-related hints, that tell bot() and others
that an update is required, into a struct. Remove it from
context since there is no reason to save those.
2024-01-04 23:16:27 -05:00
nhkeni
9bcff7b896 Merge branch 'keni-luabits2' into NetHack-3.7 2024-01-04 10:40:27 -05:00
nhkeni
c7ab9a0565 Some lua catchup and cleanup
- add nhl_pcall_handle() to wrap all nhl_pcall calls that didn't check
  return value and either panic() or impossible()
- add --loglua (unix only) to dump Lua memory and steps info to livelog
- remove old logging
- set memory and step limits on all Lua VMs
2024-01-04 10:37:38 -05:00
Pasi Kallinen
7353bf0e69 Message location for monster throwing or shooting at hero 2024-01-04 11:43:13 +02:00
nhmall
1cc90d740f replace a wav file that was acting differently than rest 2024-01-04 00:10:44 -05:00
PatR
c6897bf331 fix github issue #1191 - obj->age of oil potions
Issue reported by AmyBSOD:  several actions change the object type of
a potion rather than force creation of a replacement one, and if/when
the type was changed to oil, the age wasn't converted from absolute
to relative.  Relative age is the amount available and/or the number
of turns it will burn if applied.  The later in a game a potion got
converted into oil, the longer it would burn.  Not mentioned:  reverse
situation was also the case, although that didn't have any noticeable
effect since incorrect absolute age of former oil doesn't matter.

Not thoroughly tested.  I got a potion of oil from a horn of plenty
and it burned for 400 turns, but it might have been created directly
rather than be a rejected magic potion that was converted into oil.

Closes #1191
2024-01-03 13:29:15 -08:00
Pasi Kallinen
db4a44735e Message locations for Monster creation and teleporting 2024-01-03 10:28:16 +02:00
nhmall
6db79b9f18 Guidebook update 2024-01-02 12:34:05 -05:00
Pasi Kallinen
dc8d9d6cd0 Accessibility: Add location info to messages
Adds a new boolean option, accessiblemsg.  If on, some game messages
are prefixed with direction or location information, for example:

   (west): The newt bites!
   (northwest): You find a hidden door.

I added the info to the most common messages, but several are
still missing it.
2024-01-02 18:59:25 +02:00
PatR
d86e6e9717 clean up acurr()
Replace the early returns in acurr() and acurrstr(), eliminating a
bunch of casts.  I hope this doesn't reintroduce 'WIN32_BUG' (judging
by the previous workaround, I think that's extremely unlikely).

Also add an introductory comment to newhp().
2024-01-01 16:46:03 -08:00
nhmall
00af468020 add specialized voice for an audio assistant 2024-01-01 12:43:53 -05:00
nhmall
aeab3f69a6 update year in copyright to 2024 2024-01-01 11:04:26 -05:00
nhmall
76179ea0ba assert that u.ulevel is in range for use as index
Resolves #1189
2024-01-01 10:55:14 -05:00
Pasi Kallinen
95aceb1722 Remove double boom on cancelling a magical trap 2023-12-31 21:06:56 +02:00
Pasi Kallinen
780d30eca9 Wielded quarterstaff gives a small spellcasting bonus
From NetHack Fourk.
2023-12-31 17:53:03 +02:00
Pasi Kallinen
42a6a5df66 Cursed welded quarterstaff doesn't prevent spellcasting 2023-12-31 17:41:04 +02:00
PatR
cd91d0630b github issue #1180 - humans and murder
Issue reported by Umbire:  reviving a human corpse into a human
monster and then killing it entails murder penalty even when it is
hostile.

This is probably a non-issue.  Human monsters tend to not leave
human corpses, they leave shopkeeper corpses or sergeant corpses
and so forth.  Most human corpses created in normal play have
montraits attached and revive as a zombie, mummy, or vampire rather
than as a human.

This doesn't attempt to be clever, it just treats PM_HUMAN like
role monsters, not subject to 'murder'.

Closes #1180
2023-12-30 17:10:39 -08:00
PatR
b35d8d77a0 pull request #1147: WANT_SOURCE_INSTALL for linux
Pull request from entrez:  add support for 'make WANT_SOURCE_INSTALL=1'
to the linux.370 hints file, matching what macOS.370 already has.

I can't test for linux and don't bother with WANT_SOURCE_INSTALL on
OSX, so this hasn't been tried out.

Closes #1147
2023-12-30 16:42:04 -08:00
Michael Meyer
a831bf576b Add WANT_SOURCE_INSTALL to linux.370 hints file
WANT_SOURCE_INSTALL=1 can be specified when compiling to build NetHack
within the repo/source tree, rather than in the normal system install
location.  I find it useful for development on OSX, but it wasn't
present in any other hints files, so I've been using a custom hints file
on Linux for a while that adds the same option.  The code is based on
the macOS.370 hints file.
2023-12-30 16:40:54 -08:00
PatR
1cfa966871 pull request #1143 - menustyle:Full 'A' choice
Pull request from entrez:  in the class filtering menu for multi-drop
and for loot in-or-out of a container, make choosing 'A' without any
other filter choices (such as all, specific class(es), cursed, unpaid,
just-picked-up, &c) become a no-op.

I started with the pull request and then undid much of it.  It would
have been simpler to start from scratch.  If you don't have option
paranoid_confirmation:AutoAll set, when choosing 'A' for all-without-
prompting as the only selection, operate as the PR has made things
work:  effectively, 'A' by itself is ignored and the operation ends
with nothing happening.

However, if you do have paranoid_confirm:A set, then continue treating
'A' by itself as if 'A'+'a':  everything.  Since paranoid confirmation
is specified, that will be followed by a confirmation prompt.

This also adds a context-sensitive hint to the menu about how the 'A'
entry works, shown every time when 'cmdassist' is On or just once (per
session) when that is Off.

The documentation probably needs some updating.

Closes #1143
2023-12-30 16:33:27 -08:00
Michael Meyer
56d5bf50e5 Ignore loot/multidrop 'A' if no filter specified
The 'A' option in the #loot or 'D'rop menu selecting every selectable
item when used on its own has been the cause of many bag of holding
explosions and other typo-related frustration.  Now that it operates on
other filters rather than overriding them, actually require some other
filter be selected for it to have any effect.  This means that 'A' on
its own will do nothing, but 'A'+'a' will still act like 'A' alone
previously did.  I think this will reduce the rate of serious typo
accidents in games, without being intrusive and while still maintaining
'A' as a useful option (which I think it is, in it's 3.7 incarnation --
I use it all the time in combination with other filters, especially
justpicked).
2023-12-30 14:18:44 -08:00
Pasi Kallinen
c2fd027669 Typofix 2023-12-30 23:11:50 +02:00
PatR
d4dfb1765c curses menu revision
Redo menu sizing to eliminate one of the analyzer hacks.  There's no
need to loop through the menu entries a second time to find the last
one.  The first time can remember it.

Also, some routines were taking arguments with
 some_function(WINDOW *win, nhmenu *menu, ...)
and others with
 other_function(nhmenu *menu, WINDOW *win, ...).
Change them all to have the window pointer 1st and menu pointer 2nd.
2023-12-29 18:16:14 -08:00
nhmall
9d32956616 curses static analyzer bits
This is mostly just adding some Null guards ahead of
code that was already dereferencing pointers, so there
should be no change in behavior.

Also adds one validation of an array index that was
drawing a complaint.
2023-12-29 10:38:37 -05:00
nhmall
bed3b1d667 fix typo in attrib.c
Closes #1187
2023-12-29 08:34:13 -05:00
PatR
cb5e93e9e5 polymorphing into placeholder monsters
"human", "dwarf", "elf", "gnome", and "orc" are all flagged M2_NOPOLY;
so is "giant".  But dwarf and gnome are ordinary monsters and should
be eligible to be polymorph targets, so take the no-poly flag off of
them.  The others are used for corpses and not intended to be distinct
monsters.  But they are reasonable polymorph targets, so if player
with control picks any of them, choose a substitute.  The exception is
human, which already has special poly-self handling.
2023-12-29 02:29:16 -08:00
nhmall
01d6d94e30 non-Null handling for uhitm.c 2023-12-29 00:34:37 -05:00
nhmall
9d2d437d0e follow-up comment bit 2023-12-28 19:25:49 -05:00
nhmall
719919b16a revisit destroy_armor()
add a static function maybe_destroy_armor() to replace
the DESTROY_ARM() macro.

The DESTROY_ARM() macro expanded to legal code, but did include
side-effects of making assignments to local variable otmp (not an
argument to the macro), referenced local variable atmp (not an
argument to the macro), and sometimes setting the in_use field
on the impacted armor obj.

The assignment statements within the if (...) caused some compilers
and code analyzers to complain and suggest that perhaps
'=' should have been '==', which was incorrect.

The maybe_destroy_armor() function provides the
caller with information about whether the armor resisted,
so that appropriate action can be taken within the caller.
2023-12-28 19:17:43 -05:00
PatR
36c5843103 TTY_PERM_INVENT crash fix
The change 3 weeks ago for #4059 (to fix tty perm_invent memory leak)
resulted in nethack crashing during exit if built with TTY_PERM_INVENT
enabled and ending the game when perm_invent window isn't displayed.

This exits cleanly with or without perm_invent being shown and avoids
the memory leak which triggered the prior change.
2023-12-28 14:25:39 -08:00
Pasi Kallinen
073b0c90f3 Recalc mapseen when a special room is entered 2023-12-28 18:58:53 +02:00
nhmall
9f5f4b3c32 fix broken 'make install' with hints/linux.370 2023-12-28 11:45:36 -05:00
PatR
624eeeb58c non-Null handling for alloc.c
I wasn't very systematic but I think I eventually got everything.
Most alloc.c declarations are in global.h rather than extern.h.
2023-12-27 18:15:37 -08:00
nhmall
caf436934e NONNULLxxx for several files
src/date.c
src/mdlib.c
src/timeout.c
src/u_init.c
src/vault.c
src/version.c
src/windows.c
2023-12-27 20:11:59 -05:00
nhmall
e69c98c14a Windows follow-up: minimize pragma scope
Avoid disruption to mingw32-x64 build, by placing
some Visual Studio pragmas in #ifdef _MSC_VER
conditional blocks.
2023-12-27 15:00:08 -05:00
nhmall
3eb0fab317 Windows error checking and warnings 2023-12-27 14:56:03 -05:00
nhmall
0927726900 static analyzer bit for trap.c
src/trap.c(5794): warning: Dereferencing NULL pointer 'which'.
2023-12-27 11:13:22 -05:00
nhmall
d51e92d4bd static analyzer bit for symbols.c
src/symbols.c(532): warning: Dereferencing NULL pointer.
                             'tmpsp' contains the same NULL value as 'lastsp' did.
2023-12-27 11:10:35 -05:00
nhmall
aedbebad18 static analyzer bit for shknam.c
src/shknam.c(530): warning: Dereferencing NULL pointer 'shname'.
2023-12-27 11:05:38 -05:00
nhmall
6e654cb9a5 static analyzer bits for restore.c
src/restore.c(275): warning: Dereferencing NULL pointer. 'otmp' contains the
                             same NULL value as 'first' did.
src/restore.c(402): warning: Dereferencing NULL pointer. 'mtmp' contains the
                             same NULL value as 'first' did.
2023-12-27 11:03:25 -05:00
nhmall
e9ced6e2f9 static analyzer bit for priest.c
src/priest.c(865): warning: Dereferencing NULL pointer '((priest))->mextra->emin'.
2023-12-27 11:02:09 -05:00
nhmall
11c2586bdb static analyzer bit for pickup.c
src/pickup.c(3266): warning: Dereferencing NULL pointer 'otmp'.
2023-12-27 10:59:36 -05:00