Commit Graph

17561 Commits

Author SHA1 Message Date
nhmall
3c224fc49d update azure-pipelines.yml 2025-01-13 12:31:57 -05:00
nhmall
fd919c1560 Revert "Revert "Revert "eliminate a couple of build warnings (noticed with clang)"""
This reverts commit 6dad19a4f6.
2025-01-13 12:13:06 -05:00
nhmall
92340296ad azure-pipelines warning filter take 2 2025-01-13 12:01:16 -05:00
nhmall
6dad19a4f6 Revert "Revert "eliminate a couple of build warnings (noticed with clang)""
This reverts commit 1a8395002f.
2025-01-13 11:48:46 -05:00
nhmall
1a8395002f Revert "eliminate a couple of build warnings (noticed with clang)"
This reverts commit 7e8a04b35a.
2025-01-13 11:47:57 -05:00
nhmall
0a401253ce test CI warnings 2025-01-13 11:47:00 -05:00
nhmall
7e8a04b35a eliminate a couple of build warnings (noticed with clang)
2025-01-12T19:08:53.4759829Z ../win/curses/cursinvt.c:191:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
2025-01-12T19:08:53.4760198Z   191 |     case KEY_RIGHT:
2025-01-12T19:08:53.4767986Z       |     ^
2025-01-12T19:08:53.4967354Z ../win/curses/cursinvt.c:191:5: note: insert '__attribute__((fallthrough));' to silence this warning
2025-01-12T19:08:53.4967860Z   191 |     case KEY_RIGHT:
2025-01-12T19:08:53.4968026Z       |     ^
2025-01-12T19:08:53.4968219Z       |     __attribute__((fallthrough));
2025-01-12T19:08:53.4968404Z ../win/curses/cursinvt.c:191:5: note: insert 'break;' to avoid fall-through
2025-01-12T19:08:53.4968583Z   191 |     case KEY_RIGHT:
2025-01-12T19:08:53.4968709Z       |     ^
2025-01-12T19:08:53.4968820Z       |     break;
2025-01-12T19:08:53.5099063Z 1 warning generated.

2025-01-12T19:08:53.8002074Z ../win/X11/winX.c:995:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
2025-01-12T19:08:53.8008155Z   995 |     case NHW_TEXT:
2025-01-12T19:08:53.8008513Z       |     ^
2025-01-12T19:08:53.8032511Z ../win/X11/winX.c:995:5: note: insert '__attribute__((fallthrough));' to silence this warning
2025-01-12T19:08:53.8032899Z   995 |     case NHW_TEXT:
2025-01-12T19:08:53.8033057Z       |     ^
2025-01-12T19:08:53.8033219Z       |     __attribute__((fallthrough));
2025-01-12T19:08:53.8033395Z ../win/X11/winX.c:995:5: note: insert 'break;' to avoid fall-through
2025-01-12T19:08:53.8033644Z   995 |     case NHW_TEXT:
2025-01-12T19:08:53.8033783Z       |     ^
2025-01-12T19:08:53.8033912Z       |     break;
2025-01-12T19:08:53.8800783Z 1 warning generated.
2025-01-13 09:36:48 -05:00
PatR
34159d42e5 more PR #1364 2025-01-13 05:48:20 -08:00
nhmall
1bb0f89b82 Merge branch 'check_version' of https://github.com/argrath/NetHack into NetHack-3.7 2025-01-13 08:24:15 -05:00
nhmall
62fe9e83c6 Merge branch 'xytod' of https://github.com/argrath/NetHack into NetHack-3.7 2025-01-13 08:23:52 -05:00
nhmall
8ee014f5d1 update credits 2025-01-12 23:57:56 -05:00
SHIRAKATA Kentaro
36443c965b second argument of check_version() can take NULL
There is a code path starting at restore.c line 830.

    (void) validate(nhfp, (char *) 0, FALSE);
2025-01-13 13:57:40 +09:00
nhmall
e08a9671dc another follow-up: another bit is needed
breaks savefiles and bones.
2025-01-12 14:08:15 -05:00
nhmall
25558e1e01 follow-up
Check the correct bits before returning.
2025-01-12 13:58:13 -05:00
nhmall
bee21e3447 fix K4318
Reported by paxed. A potion of oil, that was already in the midst of exploding,
got picked up through spot_effects(), which led to it merging with
another potion of oil and the freeing of the original obj.

The original obj pointer was still held by breakobj(), and breakobj()
proceeded to delete the obj (again).

Function nesting:

 1    spelleffects()
 2     -> weffects()
 3      -> bhit()
 4       -> bhitpile()
 5        -> bhito(obj ...)
 6         -> hero_breaks(obj ...)
 7          -> breakobj(obj ...)
 8           -> explode_oil(obj ...)
 9            -> splatter_burning_oil()
10             -> explode()
11              -> zap_over_floor()
12               -> melt_ice()
13                -> spot_effects()
14                 -> pickup()
15                  -> pickup_object(obj ...)
16                   -> pick_obj(obj ...)
17                    -> addinv(obj ...)
18                     -> addinv_core0(obj ...)
19                      -> merged(obj ...)
20                       -> obfree(obj ...)
21                        -> dealloc_obj(obj ...)

 8           -> delobj(obj ...)
 9            -> delobj_core(obj ...)
10             -> obfree(obj ...)
11              -> dealloc_obj(obj ...)
12               -> impossible("obj already deleted)

This marks the exploding potion with LOST_EXPLODING, so that it won't
get picked up, or merged with another object during the long
sequence of functions, and that should take care of 15-21 above.
2025-01-12 13:50:25 -05:00
Alex Smith
a8be021913 Change monster regeneration over time to use healmon(), too
I missed this one.
2025-01-12 18:28:59 +00:00
Alex Smith
97e0e934e8 Use a common funcion for all monster healing
Previously, the code for monster healing was repeated every time it
was needed; this commit sends it all through a common function, which
will make it easier to make changes to how monster healing works in
the future.

This is just a code reorganisation and won't have any gameplay
effect unless I made a mistake.
2025-01-12 18:20:13 +00:00
Pasi Kallinen
f0a0a74dcc Hero polyed into slithy monster and sitting 2025-01-12 16:42:33 +02:00
SHIRAKATA Kentaro
9b7bcf67ba change the type of xytod()'s return value to int
xytod()'s return value is an index, so its type should be int, not coordxy.
2025-01-12 14:37:13 +09:00
PatR
59f49fda1b replace the mimic-as-monster fix
The new EXTRA_SANITY_CHECK for a monster mimicking a monster.  It
falsely triggered if the hero was hallucinating.  Just add an
assertion that the monster index is within valid range.
2025-01-11 12:24:54 -08:00
PatR
cba032d187 another mimic fix
The report (sent directly to devteam) stated that the bump-into-mimic
code might crash when bumping into a mimic that is masqueraing as
some other monster.  Mimics don't actually do that, but the Wizard
of Yendor mimics another monster via Double Trouble.  All I got from
it though is
 |Wait!  That's <other monster>!
which won't crash but is a fairly useless message.

This changes it to be
 |Wait!  That <other monster> is <the Wizard of Yendor>!
which seems a bit bland but provides useful information.
2025-01-11 02:22:23 -08:00
PatR
0fe42a67d0 eshkp->bill_p vs eshkp->bill
Use ESHK(shkp)->bill_p consistently.  The bill[] array field is used
to initialize the bill_p pointer field rather than be used directly
when manipulating shop bills.

While in there, get rid of some '#if DUMB' from pre-standard C days.
2025-01-10 20:52:25 -08:00
PatR
539f039a83 maybe fix #K4316 - segfault stumbling onto mimic
I couldn't reproduce the reported problem but the backtrace suggests
that defsyms[monst->mappearance] was probably out of bounds so that
nh_snprintf() got bad data.  That might conceivably happen if the
glyph didn't match the mimic's mappearance, but I not sure how that
would occur.

This avoids using mappearance as an index into defsyms[] and should
give an impossible if that situation does come up.
2025-01-10 14:14:00 -08:00
Pasi Kallinen
aa12620376 Fix vision with temporary clouds over pools
Vision wasn't cleared correctly when a temporary [poison] cloud
was over a pool and hero was under water while the cloud disappeared.
2025-01-10 15:49:20 +02:00
Pasi Kallinen
0e04988fec Fix another no_charge in untended shop
This time the no_charge object was being carried by a pet.

To trigger, drop an object into shop, decline to sell it,
pick up an object belonging to shopkeeper, decline to buy it,
wait for your pet to pick up the no_charge object you dropped,
teleport out of the shop, wait for shopkeeper to walk out of
the shop.
2025-01-10 15:46:09 +02:00
PatR
1928a3e12b get rid of trailing space in generated tile.c 2025-01-10 01:40:02 -08:00
PatR
a490ce5759 remove trailing spaces from src/*.c, include/*.h 2025-01-10 01:30:49 -08:00
PatR
5d7d004846 fix issue #1352 - another try at #1339
The attempt to simplify shop handling of containers keeps getting
more complicated.

Fixes #1352
2025-01-09 21:40:46 -08:00
Pasi Kallinen
de38ce2c90 Fix vision: force bolt breaking door with temp cloud 2025-01-09 19:44:21 +02:00
Pasi Kallinen
843b02ec1d Add vision sanity checking, fix more vision
- Add a vision sanity checking routine

- Recalc block point when digging a door for temporary clouds

- Add recalc_block_point after cvt_sdoor_to_door, because doorways
  on the Rogue level have no doors, and otherwise the sanity checking
  would complain.  This doesn't actually change how the Rogue level
  vision works, as it uses a different vision system

- Monster using a trap in a secret corridor revealed the corridor,
  but didn't unblock the vision unless you saw the location
2025-01-09 17:28:24 +02:00
PatR
83c0d430c9 suppress sanity_check after invalid command
Entering an invalid command, particularly <space>, while there is
some circumstance triggering sanity check warnings, becomes too
verbose.
2025-01-08 13:46:28 -08:00
Pasi Kallinen
c956e3e215 Fix vision when applying a wand of digging 2025-01-08 13:59:50 +02:00
Pasi Kallinen
256b820fe3 Fix impossible no_charge obj in untended shop
Sanity checking was complaining about a no_charge obj in untended shop.

Angry shopkeeper was accepting thrown items as no_charge objects:
To reproduce the impossible, kick down the shop door angering
the shopkeeper. While the shopkeeper is still in their shop,
throw an item they don't want into the shop. Wait for the shopkeeper
to get out of the shop.

Move the anger checking before the sell auto-accept code,
so the shopkeeper will charge for the object.
2025-01-08 12:59:08 +02:00
nhw_cron
9b71efe69e This is cron-daily v1-Apr-1-2024. 005manpages updated: recover.txt 2025-01-07 11:52:43 -05:00
nhmall
06e0eb0616 Merge pull request #1351 from https://github.com/g-branden-robinson/NetHack into NetHack-3.7 2025-01-07 10:43:37 -05:00
Pasi Kallinen
ae1a86d7be Fix vision when door is destroyed by ray effect
A door was destroyed and vision unblocked without considering
temporary (poison) clouds.
2025-01-07 17:39:46 +02:00
nhmall
85965b1b32 Visual Studio project files:directory name cleanup 2025-01-07 10:00:28 -05:00
Pasi Kallinen
b27c9102f6 Fix vision when opening a door
If a monster or hero opened a door with a temporary (poison) cloud
on it, the location could be seen through even with the cloud.
2025-01-07 15:14:27 +02:00
Pasi Kallinen
108d975694 Fix vision in guard created corridor
... when hero angers the guard, the guard's previous location
didn't get the vision blocking fixed.
2025-01-07 10:52:01 +02:00
PatR
a118869262 rephrase a recent fixes entry 2025-01-06 11:01:18 -08:00
Pasi Kallinen
f4cd5ed065 Fix vision with pushing a boulder and temp clouds
remove_object cleared the vision when the last boulder was removed
from a location, without considering temporary [poison] clouds.
This particular case happened when pushing a boulder.
2025-01-06 20:22:56 +02:00
Pasi Kallinen
274b15cd77 Fix vision when xorn digs down on a wall
A xorn inside a wall using a wand of digging to dig down, the vision
was still blocked at that location.
2025-01-06 20:11:35 +02:00
Pasi Kallinen
4392f5fa4e Fix vision in some cases with boulder falling into pool
We can't just unconditionally unblock vision for a location when a boulder
falls into a pool, because the location may also have a (poison) cloud on it.
2025-01-06 19:46:38 +02:00
nhmall
d807436c10 Windows: broken saved game restore
Apparently, restoring of saved games on Windows has been
broken since 1f36b98b, 'selectsaved' extension from Oct 10.
That change was altering the names of the files saved on disk
to a new format introduced at that time, but the game was not
opening a savefile with that same name, and the restore failed.

The code that renamed the savefile to match the internal name
was not part of 1f36b98b, it already existed prior to the new
internally-stored format.

To get things functional, this commit disables the code that
carries out the renaming of the on-disk savefile to match the
internal name in the savefile entirely, at least for now.

This relates to GitHub issue #1346 item 2.
2025-01-06 03:28:44 -05:00
nhmall
7cc118365c quiet down mips cross-compile
Even though most of these are cast to void (but not all), the
mips cross-compiler seems determined to warn about them anyway.

Suppress that particular warning altogether to quiet the build.
That is not the ideal approach, but if the normal way of whitelisting
individual cases isn't working, I'm not sure of another course of
action.
2025-01-05 15:51:11 -05:00
PatR
b2c108b416 teleporting of engulfer
Commit ba731a346b "fix shop steal when
teleporting your engulfer" mentioned that there was no longer any
message given if engulfer+hero got teleported.  Add such.  It is a
bit lame but the situation is rare enough that it should suffice.
2025-01-05 10:19:31 -08:00
Pasi Kallinen
57bf003c26 Fix rolling boulder not unblocking sight at wall of water
A rolling boulder that destroys a wall of water did not unblock
the vision at that point.
2025-01-05 13:35:21 +02:00
nhmall
a7152ad54e CROSS_TO_WASM build fix
A couple of option processing functions, one of which was called in file.c, were
recently added to sys/unix/unixmain.c, but the wasm build does not include unixmain.c,
it uses sys/libnh/libnhmain.c.

Transcribe the functions into sys/libnh/libnhmain.c.

Also, do not #include "wintty.h" for NOTTYGRAPHICS builds.
2025-01-05 05:42:24 -05:00
nhmall
ffadd254d7 follow-up: missed comment and an outdated interface 2025-01-04 23:51:34 -05:00
nhmall
be5143bb74 window-port updates
Remove start_screen() and end_screen() from the
Window-port interface.

They were only ever used by tty, and there was a comment
carried to several window-ports about how they "really
should go away. They are tty-specific"

term_start_screen() and term_end_screen() are part of
terminal/NO_TERMS supporting routines now.
2025-01-04 23:38:34 -05:00