Commit Graph
19043 Commits
Author SHA1 Message Date
Doktor L 7036f902d2 Pass base-256 colour index to curses_putch
And to its inner function write_char
2026-06-19 16:36:27 +02:00
Doktor L f3d292e111 Combine three arguments of curses_putch into one
It will need another parameter for 256-colour support. To avoid having
too many arguments, put glyph colour, background colour and attributes
into a struct and, since to curses library all of that is attributes
that are handled by same function, call the struct "gryph attributes".

curses_putch was also declared in two different headers, remove one of
those declarations.
2026-06-19 16:36:27 +02:00
Doktor L 24adb1c592 curses: use existing background parameter for pile
The blue background colour for piles was implemented by changing glyph
colour to curses colour pair with the desired background, and then
passed to curses_putch which takes character and background colour and
makes curses colour pair out of them once again.

Pass blue background to curses_putch instead and let it create curses
colour pair just once.
2026-06-19 16:36:27 +02:00
nhmall 43ae611d64 fixes5-0-1.txt entries following pull request 2026-06-19 10:20:50 -04:00
nhmall 33e2f54e7c Merge branch 'correct-regions-with-ball-travel' of https://github.com/copperwater/NetHack into NetHack-5.0 2026-06-19 10:17:40 -04:00
nhmall 04963ecf81 follow-up: add a general catch for "says" 2026-06-19 10:08:42 -04:00
nhmall 8705d12046 Merge branch 'shopkeeper-voice-respects-deaf' of https://github.com/copperwater/NetHack into NetHack-5.0 2026-06-19 10:07:11 -04:00
copperwater 7a23470c33 Fix: thrown ball travel did not check for regions
This is an issue that we discovered in TNNT last year when we added a
custom region with effects that trigger upon entry: it was possible to
bypass those effects by entering the region via a thrown iron ball.

This can be demonstrated by creating a poison gas cloud and then
dragging oneself inside the cloud behind a thrown ball: you land in the
cloud and are surrounded by poisonous gas, but are unharmed by it.

This commit fixes the iron ball code to call in_out_region when
appropriate, which handles the side effects of entering and exiting
regions in addition to preventing travel into or out of a hypothetical
region that blocks entry or exit.
2026-06-19 09:35:23 -04:00
copperwater b54c38c65b Fix: a shopkeeper msg was printed even when deaf
The message in question is '[shopkeeper] says "You be careful with my
[item]!"' when you wield a shop-owned item, but it was being printed
even when the hero is deaf.

Following other examples of shopkeeper dialogue, the correct thing to do
here is not to suppress the message if deaf but instead provide some
nonverbal feedback, so that is what I did.
2026-06-19 09:12:57 -04:00
nhmall 118899a5f0 update tested versions of Visual Studio 2026-06-18 2026-06-18 09:48:34 -04:00
nhmall 6d0757fc86 Fix MS-DOS crosscompile on macOS host 2026-06-16 19:56:30 -04:00
nhmall d13eceb28b eliminate one more source of vault guard newsym msgs
see_monsters() was producing spurious vault guard at 0,0
messages

Reproduce issue by:
    1. Entering vault via teleport.
    2. Wait for guard to enter.
    3. Drop gold (if necessary) and follow guard.
    4. Right after the guard disappears, but before
       the corridor does, the following can lead to
       the messages:
       a) control-R to refresh the display.
          or
       b) save the game and restore.

       In both cases, see_monsters() will get called and lead
       to the spurious messages for the vault guard that is
       parked.

Also, add a macro PARKEDMONSTER(mon) instead of checking the
the isgd bit and the value of mon->mx being zero in multiple
places

Also, adds MON_PARKED bit to mstate.
Currently the PARKEDMONSTER(mon) macro mentioned above,
does not use the new bit.
2026-06-14 14:31:18 -04:00
nhmall 8e9d23b578 msdos warning bit
../sys/msdos/font.c: In function 'load_font':
../sys/msdos/font.c:89:22: warning: unused variable 'j' [-Wunused-variable]
   89 |             unsigned j;
      |                      ^
2026-06-12 11:00:28 -04:00
nhmall b0e24236e3 update tested versions of Visual Studio 2026-06-12 2026-06-12 06:07:27 -04:00
PatR dfd6e0739f fix issue #1580 - item action for leash in use
Issue reported by JodiJodington:  the item action for a leash didn't
distringuish a leash that is already in use from one that isn't.

Fixes 1580
2026-06-12 01:11:43 -07:00
nhmall 6c11cac0f7 fixes5-0-1.txt entry for pull request #1581 2026-06-11 14:09:25 -04:00
Ray Chason 0248dbf550 MSDOS: Accept only single character font mappings
* makefont.lua generates incorrect PSF fonts. There can be multiple
  characters mapped to a single glyph, but the mappings should be
  separated by FE bytes.

* font.c should accept only single character mappings -- not combining
  sequences. The bundled fonts have no combining sequences, but I am
  exploring other options that provide more Unicode coverate.
2026-06-10 23:14:09 -04:00
nhmall 958415607b periodic style check: whitespace cleanup
leading tabs and trailing blanks
2026-06-10 15:52:13 -04:00
Patric Mueller 49ac961884 replace NOTPARMDECL with TPARM_WORKAROUND
The old logic used a negative check to emit an extern declaration for
tparm(). This guarded against old platforms whose curses implementations
did not declare their own functions.

If there are still any platforms left that need this declaration, they
can set TPARM_WORKAROUND to get the old behavior back.
2026-06-10 10:16:44 +02:00
nhmall 178b295701 Merge branch 'fix/overflow-checks' of https://github.com/0x0b1ade/NetHack into NetHack-5.0 2026-06-09 22:54:20 -04:00
nhmall e5a3ec9219 follow-up: whitespace bit 2026-06-09 22:50:33 -04:00
nhmall 9d44b1dbce follow-up: fixes5-0-1.txt 2026-06-09 22:49:36 -04:00
nhkeni 383d810357 re-write fetch-Lua target
cleaner output
better structure
better error checking and recovery
2026-06-09 17:22:12 -04:00
nhmall e34238d2bc MS-DOS: several fixes for the tiled map 2026-06-09 16:48:02 -04:00
nhmall 1faa85010d Merge branch 'msdos-map-fixes' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-06-09 16:36:21 -04:00
Ray Chason 1ac6ec5d1e MS-DOS: several fixes for the tiled map
VESA mode: Set the viewport size correctly so the position bar does
not overlay the map.

VESA mode: Correctly set the size to which tiles are stretched when
overview mode (F4) is selected.

Both VESA and 16 color modes: Pass correct parameters to vga_userpan
and vesa_userpan, so the pan keys (CTRL+arrow) work correctly.
Some emulations don't report CTRL with up or down arrows, so accept
CTRL-home, CTRL-page up, CTRL page down and CTRL-end.

16 color mode: Set the panning direction so CTRL-left and CTRL-right
pan in the same direction as 3.4.3.
2026-06-09 16:25:46 -04:00
PatR c8b15fe854 pull request #1557 - erinyes level adjustments
Pull request from youbo0: when hero's alignment gets low enough, the
adjusted experience level for erinyes effetively dropped instead of
increased.  It was being capped at 50 which has a special meaning for
monsters.

Change the level limit to 49 which is as high as ordinary monsters go.

Does not affect saved data.

Fixes #1557
2026-06-09 13:00:22 -07:00
nhmall 57111e3c1f update pdcursesmod submodule 2026-06-09 09:40:15 -04:00
nhmall 917cc1a596 add pair of generated files to .gitignore 2026-06-08 13:47:55 -04:00
nhmall 7e18df3c5f ensure sane values for monst fields from bones 2026-06-08 00:06:59 -04:00
nhmall c0f06ac4fd follow-up to 84a6eb5e
Ensure MON_STILL_ARRIVING bit is cleared before an early return.
2026-06-07 23:54:43 -04:00
Alex Smith b309392b5a Fixes entry for the recent bugfix 2026-06-08 04:42:44 +01:00
Alex Smith 738aa5c076 Make monsters not scared of the Sokoban rolling boulder traps
They aren't initially loaded with boulders, thus aren't dangerous.

This is particularly relevant for pets, who would otherwise be very
reluctant to follow their owners up to the level above.
2026-06-08 04:41:31 +01:00
Alex Smith 9f7a9d2c88 Prevent off-map monsters banking turns
If a monster is marked as off the map, then it is included in
iterations over the monster list, but not allowed to move. This
meant that such monsters would gain movement points on every turn
but not spend them, which could lead to the monster taking a lot of
turns in a row when placed back onto the map.

This commit removes the movement allocation from monsters that are
flagged as dead or removed from the map, meaning that they neve
get more than one turn's worth of movement allocation.
2026-06-08 04:04:12 +01:00
nhmall 28cc7cb6bf Merge branch 'msdos-colors' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-06-07 17:29:42 -04:00
Ray Chason a160322aef MS-DOS: Fix custom colors in VESA BIOS mode
The basic colors are being displayed as black. Colors specified as RGB
are not being converted to the pixel format for the current mode.  This
manifests as walls in dungeon branches being drawn in black when the
symbol set is IBMgraphics, and in the wrong color when Enhanced1 is in
use and the display mode uses 15 or 16 bits per pixel. A particular
mode that shows this bug is 1024 by 768 under DOSBox.
2026-06-07 17:09:27 -04:00
0x0b1ade 4d590abac1 Add length checks in init_dungeon_dungeons 2026-06-07 22:02:20 +08:00
nhmall cbfd3aa944 placement for the added save_currentstate() call wasn't right
in gulpmu() that particular placement would result in u.uswallow = 0,
and u.ustuck set.

A better optimal location needs to be sought.
2026-06-07 01:52:54 -04:00
nhmall 51486d0c02 fix recover failure after unexpected exit
u.ustuck and u.usteed are handled differently in 5.0.0 than
in previous releases, and an unexpected halt to NetHack could
result in an inability to use recover to get the game back.

If the hero was engulfed, u.uswallow, could get saved to the
checkpoint file with a value of 1 without a corresponding
u.ustuck_mid value representing the m_id of the engulfing monster.

Recover had no information to use to restore the u.ustuck pointer
when loading the monsters on the level.

With u.uswallow set to 1, the game would proceed to enter if-blocks
based on that, and then crash/fault when it attempted to dereference
u.ustuck, during the recover attempt.

This updates the values of u.ustuck_mid immediately before saving
struct you during a checkpoint, so that the resulting file had
u.uswallow and u.ustuck_mid values that were in concert.

It does the same for u.usteed and u.usteed_mid.

This also now adds a save_currentstate() checkpoint call when
the swallowed/unswallowed status changes, that is whenever set_ustuck()
is called.
2026-06-07 01:31:19 -04:00
nhmall 1f4198c705 aklys message improvements 2026-06-06 15:01:54 -04:00
nhmall 498db90437 follow-up: fixes5-0-1.txt entry 2026-06-06 12:29:39 -04:00
nhmall 7f787a372a Merge branch 'pl_character-overflow' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-06-06 12:27:03 -04:00
Ray Chason 19c85c1987 Don't overflow svp.plname on restore 2026-06-06 12:10:15 -04:00
nhmall ed1b4af5cd fix build on Windows arm64 2026-06-06 10:36:47 -04:00
nhmall 393f42cd6f follow-up: grammar and format string 2026-06-05 20:17:48 -04:00
Ingo Paschke 78f59660d0 mac: drop the obsolete exit getreturn
The revived mac68k port (on the m68k-wip branch) removed it: it runs
an event loop after exit_nhwindows() has torn the windowing system
down and crashes; the tombstone already pauses.  Removing it here too
keeps the block from resurfacing in NetHack-5.0 <-> m68k-wip merges.
2026-06-05 19:46:05 +02:00
Ingo Paschke 28ca8b26c3 rename MACOS9 to MAC68K to avoid confusion with modern macOS 2026-06-05 16:30:09 +02:00
nhmall 2950bd85cb Revert "don't attempt with a blank host name in fetch-lua"
This reverts commit 9566605ba2.
2026-06-04 21:17:41 -04:00
nhmall f2fc324bef Revert "follow-up"
This reverts commit 0ea0de5301.
2026-06-04 21:17:15 -04:00
nhmall d1f9c17418 Revert "yet another follow-up for Makefile.top fetch-Lua"
This reverts commit 784692fd40.
2026-06-04 21:16:44 -04:00