Commit Graph

17300 Commits

Author SHA1 Message Date
nhmall
3e903fd79a quiet warnings on recent Qt, macOS Sequoia 15.1, latest Xcode 2024-11-17 10:03:04 -05:00
nhkeni
4f3c463d69 remove some testing junk that escaped 2024-11-16 17:39:40 -05:00
nhmall
7932497450 follow-up for Makefile.nmake 2024-11-16 10:45:22 -05:00
nhmall
21b495f835 Makefile.nmake build fix when no curses options
Resolves #1325
2024-11-16 10:10:10 -05:00
nhkeni
d493d31aec Remove "*.txt NHSUBST" from .gitattributes because it's too general.
Specifically, it was marking Guidebook.txt for substitution, but
it's a derived file, not a source.
2024-11-15 19:00:31 -05:00
SHIRAKATA Kentaro
aba2bda159 split eval_offering() into a separate function 2024-11-16 04:10:11 +09:00
nhmall
13db1aed0d replace stray tabs that have crept in 2024-11-14 11:54:39 -05:00
Pasi Kallinen
62971c6f09 Qt: add support for the palette config option
Depends on CHANGE_COLOR compile-time option.
2024-11-14 17:25:44 +02:00
nhmall
c7591c0e08 remove redundant zeroing 2024-11-13 17:36:47 -05:00
nhmall
b8083733de some sys.c orphaned pointer prevention 2024-11-13 17:14:47 -05:00
nhmall
7ff17845c6 Windows MSYS2 build fix 2024-11-13 16:14:49 -05:00
nhmall
c16c87a897 Merge branch 'early_return' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-13 14:54:34 -05:00
nhmall
52a9af7278 early_init() was being called twice on Windows GUI 2024-11-13 13:57:18 -05:00
nhmall
fa9210aa65 Windows: free more allocated memory before exit
This gets rid of the final leak complaint on Windows as of Nov 13, 2024
2024-11-13 13:48:50 -05:00
nhmall
c85b5d3e56 rearrange function layout in Windows windmain.c 2024-11-13 13:48:03 -05:00
nhmall
5c28b9e987 fix another memory leak
In sys_early_init(), the values for sysopt.gdbpath and
sysopt.greppath were being assigned by calling dupstr()
without ensuring that a value previously assigned by
dupstr() were free()'d.

Also, the sysopt struct definition is changed to sysopt_s,
not because there's anything wrong with the original
    struct sysopt sysopt;
but because I couldn't convince the debugger to use the
correct thing when trying to track down the leak.
2024-11-13 09:07:10 -05:00
nhmall
277a0e4464 Windows NetHackW.c bit 2024-11-12 19:30:43 -05:00
nhmall
724f8f865c more memory freeing before exit on Windows 2024-11-12 18:51:04 -05:00
nhmall
0e52eac184 update tested versions of Visual Studio 2024-11-12 2024-11-12 18:00:37 -05:00
SHIRAKATA Kentaro
2ee31972a5 unify to early return on offer_corpse()
* remove redundant `else`
 * reduce indent
2024-11-12 22:50:17 +09:00
nhmall
7414b906b2 release some memory before exit under Windows 2024-11-11 16:50:57 -05:00
nhkeni
fd0b67de4d Fix leak in crashreport_init() under Windows 2024-11-11 15:21:59 -05:00
nhkeni
91c38355e7 Merge branch 'keni-gitset2' into NetHack-3.7 2024-11-11 11:27:27 -05:00
nhkeni
36e8d9e6fc nhgitset version 4
To update, run "perl DEVEL/nhgitset.pl"

Fixes:
- "nhcommit -a" has been fixed
- NHDT was hardwired in places
- no longer complain about a missing dat directory outside of the
    NetHack source tree
- make update of gitinfo atomic
- Replace some hardwired directory separators with OS-dependent constructs

Backwards Incompatibilities:
- NH_DATESUB's DATE() is now Date() to match the other variables
- MSYS2 requires an additional Perl package - the MSYS2 docs have
    been updated

New Help System:
- git nhhelp
   This command mirrors "git help" for nh* commands.
- See git nhhelp nhsub for general help on substitution variables

New Substitution Variables:
-Brev()
    An aBREViation of $PREFIX-Branch$:$PREFIX-Revision$ - this
    may help get line length under control in file headers.
-Assert(TYPE=VALUE)
    If TYPE does not match VALUE, do not substitute on this line.
    TYPE P checks VALUE against nethack.substprefix
-Project(arg)
    Returns nethack.projectname if there is no arg and an uppercase
    version if arg is uc.

Other New Features:
- Add nethack.projectname
- Documentation updates - see "git nhhelp nhsub"
- On checkout or merge of a branch, check for nhgitset version updates
  and provide an optional message to the user.
- Move NH_DATESUB substitutions here from cron job to keep dates in sync
- PREFIX-* keywords now available in NH_DATESUB templates
- Support use of nhgitset.pl from a different repo; note that update
  checks will be dependent on keeping the original source repo up-to-date
  and in the same location.
2024-11-11 09:15:49 -05:00
SHIRAKATA Kentaro
93072b8784 shrink scopes of some vars on offer_corpse() 2024-11-11 17:34:32 +09:00
nhmall
e83e04dbb3 fix some memory leaks 2024-11-10 22:24:45 -05:00
nhmall
d428beb8dd remove an unused prototype 2024-11-10 17:58:04 -05:00
nhmall
9a7dcf16a3 rm.h comment update 2024-11-10 17:49:54 -05:00
nhmall
dacad054cc Merge branch 'offer_corpse' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-10 10:35:13 -05:00
nhmall
bbcd161e5f follow-up: prompt message bit 2024-11-10 10:19:58 -05:00
nhmall
c87a373b11 more follow-up related to #1320 2024-11-10 10:06:07 -05:00
SHIRAKATA Kentaro
e23095a829 omit return value of offer_corpse(), as it is always ECMD_TIME 2024-11-10 22:46:31 +09:00
nhmall
5cc529efc8 follow-up related to #1320
This is additional groundwork related to
https://github.com/NetHack/NetHack/issues/1320

This additional groundwork just puts some safeguards
in place to make it rather tough to end up with an
instant death from handling a cockatrice corpse in
your inventory without appropriate protection.

At this point, still no actual petrification will occur.
2024-11-09 23:49:10 -05:00
nhmall
a40d85a430 Merge branch 'offer_corpse' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-09 14:47:33 -05:00
nhmall
9c554895b1 adjust wish for cockatrice corpse
Wishing is powerful, so if you cannot safely handle a cockatrice
corpse, then have a wish for one result in the corpse materializing
on the floor rather than in your inventory.

Resolves #1320
2024-11-09 14:06:43 -05:00
nhmall
36d8998edb try not including trees when check_pos() returns it's 3rd argument.
Related to #1309
https://github.com/NetHack/NetHack/issues/1309

K2 commented: "This might help - k21971/EvilHack@afed641"

A comment in there states:
"Fix: sections of wall being visible when they shouldn't yet.
This has been a long-standing bug for as long as I can remember, and qt
appears to have figured it out. What was happening: the player would all
of the sudden see a section of wall in an area that they hadn't explored
yet. It was discovered that this was only occurring if that section of
wall had any type of tree up against it."

The fix there attempts to leave trees out of the check_pos non-zero return,
so give that a shot.

I didn't attempt to reproduce the situation myself,
and therefore cannot confirm that this does resolve it.

Feedback on effectiveness or side-effects are welcomed. If someone is
able to confirm that this resolves the issue without creating new
issues, we can close it, otherwise this can be reverted.
2024-11-09 11:40:09 -05:00
nhmall
1dbba0f63b rename IS_ROCK() macro to IS_OBSTRUCTED()
It has included trees since they were added, so give it a
more fitting name.
2024-11-09 11:12:42 -05:00
nhmall
f1743d0e5c more rm.h comment updates 2024-11-09 10:58:58 -05:00
nhmall
a74badd271 rm.h comment updates 2024-11-09 10:53:48 -05:00
SHIRAKATA Kentaro
db460a4fcf split offering a corpse into a separate function 2024-11-09 02:35:19 +09:00
nhmall
aaf324bcb4 comment bit in polyself.c 2024-11-07 16:29:45 -05:00
nhmall
9e75dec8f3 Merge branch 'negative_valued' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-07 10:37:38 -05:00
nhmall
e863583c56 iterating gi.invent (github issue #1315)
GitHub issue #1315 points out that it is possible for
a downstream function to change an object's nobj field
to point to a completely different chain.

The cited example by @vultur-cadens was:

     for (obj = gi.invent; obj; obj = obj->nobj)
         if (obj->oclass != COIN_CLASS && !obj->cursed && !rn2(5)) {
             curse(obj);
             ++buc_changed;
         }

    curse() drops the weapon with drop_uswapwep(),
        which calls dropx(),
            which calls dropy(),
                which calls dropz(),
                    which calls place_object().

place_object alters the nobj pointer, to point to the floor chain:
    otmp->nobj = fobj;
    fobj = otmp;

The result was that the next loop iteration was then using floor
objects from the floor chain.

This alters several for-loops to use a more consistent approach,
particularly when the obj is being handed off to a function,
where a downstream function might, or might not, alter the nobj
field.

References:

https://github.com/NetHack/NetHack/issues/1315
https://www.reddit.com/r/nethack/comments/1gkc9ub/even_if_you_drop_an_item_before_drinking_from_the/
2024-11-06 16:59:51 -05:00
SHIRAKATA Kentaro
ffe2dfc17c split offering negative valued items into a separate function 2024-11-07 03:30:13 +09:00
SHIRAKATA Kentaro
b953625e5b early return when value == 0 on dosacrifice()
`calc_value()` returns a non-negative value, and there is no code that sets `value` to 0 after this point.
2024-11-05 15:30:07 +09:00
SHIRAKATA Kentaro
955c2c5faf early return on dosacrifice()
... to reduce indents and prepare further refactorings.
2024-11-05 00:50:19 +09:00
nhmall
091a709cdb follow-up: NetHack typically passes ptr to coord 2024-11-03 09:21:19 -05:00
nhmall
82bca3d78a Merge branch 'use_leash' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-03 09:16:09 -05:00
nhmall
e4b334e8b9 Merge branch 'sacrifice_value' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-03 09:12:01 -05:00
nhmall
aba796bb08 Merge branch 'rock_disppear_msg' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-03 09:10:16 -05:00