Commit Graph
18965 Commits
Author SHA1 Message Date
nhmall 05371dd481 some tipping fixes
- adjust the surface name in prompts (resolves a TODO in the code).
- be more player-friendly with the prompting, and don't prompt a
second time if the floor/surface is the only tip-destination, as
that can be annoyng and viewed as unnecessary. Instead, include
that information in the first decision prompt.

Resolves #1537
2026-05-24 00:01:50 -04:00
nhmall 7025945d2a Get CROSSCOMPILE defined earlier in the Makefiles 2026-05-23 22:50:12 -04:00
nhmall 2680476825 fixes entry for the big-endian fix 2026-05-23 21:37:56 -04:00
nhmall 58f2ef3a9e Merge branch 'lua-coordxy-bigendian' of https://github.com/ingpaschke/NetHack into NetHack-5.0 2026-05-23 21:31:44 -04:00
Ingo Paschke 4470ce348e lua: read coordxy fields with the right width (big-endian fix)
Add ANY_INT16 to any_types and use it for u.ux/uy/tx/ty and uz
dlevel/dnum.  These are coordxy (int16_t) but the Lua bindings were
treating them as 1-byte fields, so on big-endian m68k Lua read the
high byte (0) instead of the actual value.  Symptom: place_object
off map <0,0> in the tutorial.
2026-05-24 02:55:57 +02:00
nhmall ff4abc9b8c 3rd time is the charm3rd time is the charm3rd time is the charm 2026-05-23 20:05:54 -04:00
nhmall d7726e6069 follow-up grammar bit 2026-05-23 20:03:30 -04:00
nhmall 94e7d0bcf3 fixes5-0-1.txt catch-up 2026-05-23 20:01:06 -04:00
nhw_cron 0536318099 This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-23 19:16:10 -04:00
nhmall fd4fd6ef86 README-hints -> README.hints 2026-05-23 13:43:06 -04:00
nhmall 6aed21933d add paragraph about README.hints to NewInstall.unx 2026-05-23 13:33:35 -04:00
nhw_cron 2808f45c70 This is cron-daily v1-May-7-2026. 005guidebook updated: doc/Guidebook.txt 2026-05-22 16:37:10 -04:00
nhmall 3ea7fd3d67 stamp Guidebook with date of most recent commit to it 2026-05-22 15:41:18 -04:00
Ingo Paschke 1e34b52648 share: extend pcmain.c nhuuid to CROSS_TO_MSDOS, drop stub
The MSDOS branch carried a zero-filled placeholder with a FIXME; it
can use the same RFC 4122 v4 path as Atari and Amiga.
2026-05-22 15:21:00 -04:00
Ingo Paschke ced5744fe6 share+amiga: gate pcmain.c nhuuid for CROSS_TO_AMIGA, drop amidos.c copy
amidos.c had a byte-identical copy of the RFC 4122 v4 generator
already living under CROSS_TO_ATARI in sys/share/pcmain.c.
2026-05-22 15:20:50 -04:00
nhmall 189a0b8c3f update tested versions of Visual Studio 2026-05-22 2026-05-22 14:46:17 -04:00
nhmall be4d613bff follow-up curses idlecheckpoint 2026-05-22 14:20:13 -04:00
nhmall e394dc341b prevent a checkpoint from executing too early 2026-05-22 12:25:13 -04:00
nhmall a1fad59f2d idlecheckpoint support in curses 2026-05-22 12:24:32 -04:00
nhmall 4c7f2dfaac some Windows curses adjustments dialog on startup 2026-05-22 12:21:42 -04:00
Alex Smith 3f837939ba Change the MAX_REROLLS option to be MAX_REROLL_RATE
Having a hard cap on the number of rerolls doesn't help save CPU
usage from excessive rerolling, because if the cap is set low
enough to keep the CPU usage reasonable it isn't high enough for
players to actually use the feature.

Instead, allow capping the number of rerolls per second. (Sensible
values seem to be in the 5-10 range.) If the player attempts more
rerolls than this, show a paranoid confirmation prompt: the need to
type the answer to the prompt will slow a human user down (and if
the prompt is filled in too quickly, it will simply just be shown
again, preventing attempts to use automation to skip the prompt).
2026-05-22 06:02:00 +01:00
Ingo Paschke 7d512fd8ce shk: show item glyphs in the pay-bill menu
menu_pick_pay_items() passed &nul_glyphinfo to add_menu so
port windowports never had a tile/glyph to render alongside
each entry on the bill.  Compute the proper glyph_info from
the bill's obj, matching the pattern src/invent.c already
uses for inventory menus.
2026-05-21 16:05:47 -04:00
nhmall 3beaf04c45 fixes update for menu glyphs: shop bills, tip/loot 2026-05-21 15:54:27 -04:00
Ingo Paschke e14cb40a6e pickup: show container glyphs in tip/loot menus
doloot_core(), choose_tip_container_menu(), and
tipcontainer_gettarget() each iterate carried or floor containers
and offer them as menu rows, but passed &nul_glyphinfo so port
windowports had nothing to render alongside.  Compute proper
glyph_info from each container the same way src/invent.c
already does for inventory menus.
2026-05-21 15:47:55 -04:00
nhmall b9d87fea6d fix a buffer overlow introduced in recent commit 2026-05-21 12:04:01 -04:00
nhmall 18845b6f67 match magic object tiles with mundane counterparts
Fixes #1533
2026-05-21 10:44:29 -04:00
nhmall 65646e2a8c fix recently appearing warnings in clang-22 and visual studio
clang-22:

invent.c:2621:16: warning: variable 'option' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
 2621 |     } else if (!hit_reroll_limit(u.uroleplay.numrerolls)) {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
invent.c:2629:9: note: uninitialized use occurs here
 2629 |     if (option == 'y') {
      |         ^~~~~~
invent.c:2621:12: note: remove the 'if' if its condition is always true
 2621 |     } else if (!hit_reroll_limit(u.uroleplay.numrerolls)) {
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
invent.c:2570:16: note: initialize the variable 'option' to silence this warning
 2570 |     char option;
      |                ^
      |                 = '\0'
1 warning generated.

visual studio:

src/invent.c(2629,1): warning C4701: potentially uninitialized local variable 'option' used
2026-05-21 10:36:22 -04:00
Pasi Kallinen 51f486589c Add sysconf MAX_REROLLS option
Public servers probably want to set this.
2026-05-21 09:11:24 +03:00
nhmall 0f8f8f4892 Windows console dev debug line 2026-05-21 01:26:29 -04:00
nhmall f9165e66fc curses display sizes on Windows console, GUI 2026-05-20 08:55:28 -04:00
nhmall 93786ddfd9 add a fixes5-0-1.txt entry for WANT_SYSTEM_LUA=1 2026-05-20 08:00:02 -04:00
nhw_cron 1eb91a61af This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-20 07:41:49 -04:00
nhmall 1b7e529732 cross-compile and build adjustments
Tested:
    Ubuntu: make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 resp=1 update
    Ubuntu: make WANT_SYSTEM_LUA=1 WANT_WIN_TTY=1 WANT_WIN_CURSES=1 resp=1 update
    make CROSS_TO_MSDOS=1 package
    make CROSS_TO_AMIGA=1 all
    make CROSS_TO_AMIGA=1 package
2026-05-20 00:37:02 -04:00
nhmall 4c825ed9a9 typo CROSS_TO_MSDOS=1 2026-05-19 15:38:37 -04:00
nhmall b17eafa0ab CROSS_TO_AMIGA=1 build fix
Fallout from other work this past weekend.
2026-05-19 12:18:23 -04:00
nhmall 182dd93a38 remove a debug line 2026-05-19 11:53:54 -04:00
nhmall 46735de8a6 extend WANT_SYSTEM_LUA=1 to other distros
Only tested on Ubuntu at this point.

feedback on other distros is welcome
2026-05-19 11:38:05 -04:00
nhmall 5333747f02 Add some support for Alpine Linux system Lua package
Requires apk add lua5.4-dev (for the C Lua headers)
2026-05-19 00:49:30 -04:00
nhmall 721dc27f26 remove an unneeded change from earlier CROSS_TO_MSDOS 2026-05-18 16:09:36 -04:00
nhmall 68e36aff74 CROSS_TO_AMIGA fix 2026-05-18 16:06:15 -04:00
nhmall 9841830460 some more follow-up
CROSS_TO_MSDOS build
2026-05-18 15:46:54 -04:00
nhmall 95151d99fc more follow-up
CI still had a duplicate tile.o
2026-05-18 14:18:24 -04:00
nhmall 0607d6426c follow-up 2026-05-18 13:53:02 -04:00
nhmall 3a892160df macOS follow-up 2026-05-18 13:07:13 -04:00
nhmall 29951cccd1 add support for optional builder-created make.prefs
Set things up so that the Makefile build will look for 'make.prefs'
at the top of the NetHack source tree.

If 'make.prefs' is present, the Makefile build will include it
just ahead of the PRE section of a hints file specified to
sys/unix/setup.sh, or practically the first thing during a
Makefile build if no hints file was specified.

The advantage of using a 'make.prefs' is that instead of putting a
series of Makefile variable value assignments on the command line
each time, like this:
    make WANT_WIN_X11=1 WANT_WIN_TTY=1 WANT_WIN_CURSES=1 c2x=1 resp=1 update
you can, instead, put those preferences into make.prefs, like this:

# start of make.prefs
WANT_WIN_X11=1
WANT_WIN_TTY=1
WANT_WIN_CURSES=1
c2x=1
resp=1
# end of make.prefs

Now, my make command just needs to specify a target:
    make update

The syntax for checking whether make.prefs exists, and for including
it, is GNU make, or bsd make, specific, so sys/unix/mkmkfile.sh will
insert the correct syntax for the make that is in-use when
sys/unix/setup.sh is executed.

The 'make.prefs' file isn't limited to Makefile variable assignments, and
can contain any valid make syntax for the version of make on your system,
but adding make syntax beyond Makefile variable assignment will cause
your make.prefs file to become specific to that version of make. There
are syntactical differences between GNU make and bsd make, particularly
for directives and conditional tests.

The 'make.prefs' file can potentially eliminate much/all of the manual
editing of distributed repository Makefiles or hints files that you, as
a NetHack developer or builder, might routinely carry out.
You have the option of placing your preference changes in 'make.prefs'
instead.

Related reference for .500 hints file variables:

In the NetHack source tree:
sys/unix/README.hints

On GitHub:
https://github.com/NetHack/NetHack/blob/NetHack-5.0/sys/unix/README-hints

For example, on macOS, where GNU make is being used, and I typically
set things up using the macOS.500 hints file:
    sys/unix/setup.sh sys/unix/hints/macOS.500
I might have the following make.prefs in the root of my NetHack source tree:
#---- snip -------
$(info Attention - Using make.prefs)
WANT_MACSOUND=1
resp=1
#---- end-snip ---

For another example, on Linux, where GNU make is being used, and I
typically set things up using the linux.500 hints file:
    sys/unix/setup.sh sys/unix/hints/linux.500
I might have the following make.prefs file in the root of my NetHack
source tree:
#---- snip -------
$(info Using make.prefs)
WANT_WIN_X11=1
WANT_WIN_TTY=1
WANT_WIN_CURSES=1
c2x=1
resp=1
#---- end-snip ---
2026-05-18 13:03:31 -04:00
nhmall d9bc6d7b8a Revert "add #-EARLY section"
This reverts commit 85ca1cce74.
2026-05-17 20:54:08 -04:00
nhmall 85ca1cce74 add #-EARLY section 2026-05-17 20:38:10 -04:00
nhmall 8ce430bd89 put the values on other pdcurses platforms back
They were set this way on other pdcurses platforms prior
to this recent change, so leave them at those values.
2026-05-16 22:13:40 -04:00
nhmall 125800404b fixes5-0-1.txt catch-up 2026-05-16 21:45:30 -04:00
nhmall 51011e234d build fix attempt for msdos cross-compile
Recent change was #ifdef PDCURSES, but that is
also used on msdos and other platforms
2026-05-16 21:41:05 -04:00