Commit Graph
100 Commits
Author SHA1 Message Date
nhmall 60dc14952d overflow if 'word' arg points to full QBUFSZ buf
This prevents a buffer overflow that was encountered during fuzzing,
but the underlying issue in the caller dodip() is still pending.

That appears to be the result of 'obuf' not being filled with
appropriate content prior to being used at line 2343 in potion.c.
2024-09-14 12:54:34 -04:00
nhmall 2410bd9e8a fix an automatic addition by CVS back in 2002 2024-09-14 11:34:24 -04:00
nhmall 0bf6f1b247 Improve Guidebook *roff formatting and markup
Pull request #1280 from g-branden-robinson

References:
https://github.com/NetHack/NetHack/pull/1280

Closes #1280
2024-09-14 11:26:23 -04:00
nhmall bf72423fb0 Merge branch 'NetHack-3.7' of https://github.com/g-branden-robinson/NetHack into NetHack-3.7 2024-09-14 11:15:41 -04:00
nhmall a2ec46a640 Merge branch 'moverock_core' of https://github.com/argrath/NetHack into NetHack-3.7 2024-09-14 10:25:08 -04:00
nhmall cbb32ac64a glyph_to_cmap() becomes function instead of macro
Also adds swallow and explosion glyphs to glyph_to_cmap()

References:
https://github.com/NetHack/NetHack/pull/1022 by argrath
https://github.com/NetHack/NetHack/pull/1277 by ars3niy

Closes #1277
Closes #1022
2024-09-14 10:12:09 -04:00
nhmall 04433aead8 Merge branch 'custom-swallow-glyphs' of https://github.com/ars3niy/NetHack into NetHack-3.7 2024-09-14 09:52:18 -04:00
nhmall bf1af7c471 Merge branch 'NetHack-3.7' of https://github.com/klorpa/NetHack into NetHack-3.7 2024-09-14 09:17:48 -04:00
nhmall 5091ac3fdd Guidebook.txt update Sept 13, 2024 2024-09-13 13:28:32 -04:00
nhmall 439c2a0352 Guidebook catch-up
S_engrcorr
S_engroom
2024-09-13 13:05:11 -04:00
nhmall bddc26faf6 debug_fuzzer follow-up 2024-09-09 17:40:00 -04:00
nhmall d852d54e4c debug_fuzzer change
I don't always want to abort() on an impossible() when debug_fuzzing,
especially if the first impossible() encountered isn't related to the
bug I'm in the midst of trying to hunt down.

I often have breakpoints on impossible() anyway, and I'd like a simple
way to avoid the panic() call during a lengthy debug session.

Make iflags.debug_fuzzer an xint8 instead of a boolean.
Call abort() only if iflags.debug_fuzzer is set to 1.

That allows setting iflags.debug_fuzzer to 2 in order to bypass the
abort call, and make use of other breakpoints that have been set
to narrow down a particular issue.
2024-09-09 17:26:53 -04:00
nhmall bcdf077d9f avoid any potential hassle with C23 unreachable macro 2024-09-07 11:34:12 -04:00
nhmall 33652b8288 remove extraneous script file (Windows) 2024-09-07 10:13:04 -04:00
nhmall 9a09bcdfc9 remove extraneous change from pr 2024-09-03 12:22:37 -04:00
nhmall 78042680b8 update tested versions of Visual Studio 2024-09-01 2024-09-01 09:39:56 -04:00
nhmall 7dfb57ac2e git credential helper documentation update
The most-current macOS version is greater than 12 (15 at time of
this change).

Expand Windows suggestions to include variations specific to MSYS2 and WSL2.
2024-09-01 09:31:35 -04:00
nhmall 0dff31a745 suppress display.c warning introduced by 4fb7dd2c
src/display.c(997): warning C4127: conditional expression is constant
2024-08-29 14:04:40 -04:00
nhmall 2ed95119f1 update tested versions of Visual Studio 2024-08-02 2024-08-02 13:24:20 -04:00
nhmall 35dfcb6810 NetHack Daily Cron Output (1 commits) 2024-08-01 09:57:18 -04:00
nhmall 4353ee49d8 sed substitution went too far (wasm cross-compile)
Also, link with hacklib
2024-07-28 12:27:02 -04:00
nhmall faca234055 follow-up for dig_check changes
Use the is_hole() macro to cover off holes and trapdoors.
2024-07-23 16:22:30 -04:00
nhmall 082671ab0d follow-up for digcheck_fail_message() 2024-07-23 10:51:42 -04:00
nhmall 906813f0b2 fixes update
Closes #1245

Previous commit had a typo of 1254 in the reference
2024-07-23 01:11:04 -04:00
nhmall d5785f287e GitHub issue #1254
> If there's a trap on a no-dig level, the floor beneath it will always be "too hard to dig into", making it impossible to remove the trap.
>
> As you can still dig pits in these levels (just not holes), the floor under the trap itself resisting to become a pit seems inconsistent.
>
> Steps to reproduce:
>
> Go to no-dig level like Mine's End
> Make a trap
> Dig a pit next to it -> works
> Dig on the trap -> does not work

Return more information about the dig_check() results to caller (was
just a boolean).

Move the messaging that was in dig_check() into a separate
digcheck_fail_message() function that uses the expanded return
information.

Resolves #1254

.
2024-07-23 01:06:24 -04:00
nhmall a7240f8689 update tested versions of Visual Studio 2024-07-17 2024-07-17 10:02:25 -04:00
nhmall e44bfe4eb2 fix sentence structure in Guidebook.tex
Commit 59fbffd1 neglected to include the closing ')'
2024-07-17 08:13:11 -04:00
nhmall afe0d03678 fix Guidebook.tex 2024-07-17 08:00:46 -04:00
nhmall 0eb7f109e0 follow-up, program_state 2024-07-13 16:31:35 -04:00
nhmall 6c0ae092c6 distinguish global variables that get written to savefile
The g? structs had a mix of variables that were written to
the savefile, and those that were not.

For better clarity and to distinguish those that end up in
the savefile, relocate some g? variables that get written
directly to the savefile into different structs.

This updates EDITLEVEL, although technically it probably
didn't need to, since savefile contents are not changing.

Details:

    gb.bases            -> svb.bases
    gb.bbubbles         -> svb.bbubbles
    gb.branches         -> svb.branches
    gc.context          -> svc.context
    gd.disco            -> svd.disco
    gd.dndest           -> svd.dndest
    gd.doors            -> svd.doors
    gd.doors_alloc      -> svd.doors_alloc
    gd.dungeon_topology -> svd.dungeon_topology
    gd.dungeons         -> svd.dungeons
    ge.exclusion_zones  -> sve.exclusion_zones
    gh.hackpid          -> svh.hackpid
    gi.inv_pos          -> svi.inv_pos
    gk.killer           -> svk.killer
    gl.lastseentyp      -> svl.lastseentyp
    gl.level            -> svl.level
    gl.level_info       -> svl.level_info
    gm.mapseenchn       -> svm.mapseenchn
    gm.moves            -> svm.moves
    gm.mvitals          -> svm.mvitals
    gn.n_dgns           -> svn.n_dgns
    gn.n_regions        -> svn.n_regions
    gn.nroom            -> svn.nroom
    go.oracle_cnt       -> svo.oracle_cnt
    gp.pl_character     -> svp.pl_character
    gp.pl_fruit         -> svp.pl_fruit
    gp.plname           -> svp.plname
    gp.program_state    -> svp.program_state
    gq.quest_status     -> svq.quest_status
    gr.rooms            -> svr.rooms
    gs.sp_levchn        -> svs.sp_levchn
    gs.spl_book         -> svs.spl_book
    gt.timer_id         -> svt.timer_id
    gt.tune             -> svt.tune
    gu.updest           -> svu.updest
    gx.xmax             -> svx.xmax
    gx.xmin             -> svx.xmin
    gy.ymax             -> svy.ymax
    gy.ymin             -> svy.ymin

Related note:
There are some pointer variables that are heads of chains that were not
moved from 'g?' to 'sv?', because they are not actually written to the
savefile directly, but the objects/monst/trap/lightsource/timer in the
chains they point to are. That can be changed, if desired.
Examples: gi.invent, gm.migrating_objs, gb.billobjs, gm.migrating_mons,
          gf.ftrap, gl.light_base, gt.timer_base
2024-07-13 14:57:50 -04:00
nhmall fbda1183d7 comment bit 2024-07-07 10:40:03 -04:00
nhmall a86b9e6899 update tested versions of Visual Studio 2024-06-13 2024-06-13 09:05:01 -04:00
nhmall d04c0f00ed follow-up bit (from leading tab replacements) 2024-06-10 11:02:52 -04:00
nhmall 588b3ae92f replace some leading tabs that had crept in 2024-06-10 10:57:59 -04:00
nhmall 16ac21297a update tested versions of Visual Studio 2024-05-04 2024-06-04 07:45:23 -04:00
nhmall 8b0ea3f204 remove inappropriate PDCURSES use of stdin,stdout
Use of stdout and stdin was inappropriate for general curses.
Windows GUI links with PDCURSES wingui code.
2024-06-04 06:46:25 -04:00
nhmall 26b12f83fe update tested versions of Visual Studio 2024-05-16 2024-05-16 12:27:56 -04:00
nhmall 38d2294257 revert 184c9e3b and re-commit partial
Reason: The following concern was raised:
"The trademark indicators were not out of sync.  The Guidebook
uses footnotes for that, 'history' uses "(tm)" in the text which
works better when nethack displays the text."
2024-05-13 14:12:38 -04:00
nhmall 5e765679c8 Revert "Merge branch 'update-history' of https://github.com/argrath/NetHack into"
This reverts commit 184c9e3b92, reversing
changes made to 8e6f3ccc7d.
2024-05-13 14:09:01 -04:00
nhmall 86bb71ef76 merge pr #1213
@Umbire wrote:
Very simple change code-wise - if he's gonna use a yumi a hunter of his expertise should presumably have the projectiles match.

Closes #1213.
2024-05-13 12:58:02 -04:00
nhmall 184c9e3b92 Merge branch 'update-history' of https://github.com/argrath/NetHack into
NetHack-3.7

@argrath reported that some of the text had fallen out of sync.

Closes #1225.
2024-05-13 12:52:07 -04:00
nhmall 68169708dc follow-up
replace dependency that was removed but should not have been
2024-05-13 08:54:56 -04:00
nhmall 29bf3646e0 add makedefs options for producing individual files
This may be useful for some build environments to avoid parallel make
issues, and artificially-concocted order dependencies, leaving the ordering
up to that specified in the Makefile.

The related makedefs options are now:

       ‐s     Generate the bogusmon , engrave and epitaph files.

       ‐1     Generate the epitaph file.

       ‐2     Generate the engrave file.

       ‐3     Generate the bogusmon file.

Also resolves an existing issue encountered in doc/makedefs.6 where "and epitaphfiles"
was being produced in the result.
2024-05-13 08:45:11 -04:00
nhmall 97916007ef restrict font fallback to legacy Windows console
It was misbehaving with ENHANCED_SYMBOLS so restrict the font fallback
to the legacy Windows console for now.
2024-05-12 08:12:30 -04:00
nhmall 329ffae7df simple O menu requires clear screen for symset 2024-05-12 08:10:36 -04:00
nhmall 38e8e99565 Windows symbols copying
Avoid leaving outdated symbols file in place when there is a newer one.
2024-05-12 08:06:41 -04:00
nhmall 389a17bf02 Merge branch 'hardware-shop-string' of https://github.com/nethackathon/NetHack into NetHack-3.7 2024-05-07 12:30:08 -04:00
nhmall 93a44c05d1 let the compiler -Wswitch catch unhandled shop_string types 2024-05-07 12:24:57 -04:00
nhmall fce82ac0f3 Merge branch 'patch-4' of https://github.com/nikolas/NetHack into NetHack-3.7 2024-05-07 10:15:17 -04:00
nhmall 1d7abb0b58 cross-compile requires two distinct hacklib.a libraries
One to link with the stuff that needs to be built and executed on
the build host during the build, such as makedefs.

One to link with the stuff that will run on the target platform.
2024-04-27 17:24:47 -04:00
nhmall 9ae6f4e77e warning fix if SYSCF is not defined 2024-04-27 10:00:28 -04:00
nhmall 1e6d5317e5 warning bit report.c 2024-04-27 09:08:08 -04:00
nhmall 59bd1ce687 update tested versions of Visual Studio 2024-04-19 2024-04-19 14:17:47 -04:00
nhmall e20774e16f updated workaround for vs conflict 2024-04-15 12:52:08 -04:00
nhmall 7e6dab38c5 work around a conflict with visual studio build 2024-04-15 12:45:49 -04:00
nhmall 2ce6df8be5 yet another follow-up 2024-04-15 12:28:00 -04:00
nhmall 8b48032e74 follow-up for Makefile.mingw32 2024-04-15 12:24:59 -04:00
nhmall 53e4e2e12a update Makefile.mingw32 res file dependencies 2024-04-15 12:12:47 -04:00
nhmall 453eacdcb6 include the manifest in NetHackW res 2024-04-15 12:09:23 -04:00
nhmall 141dc9e52e Merge branch 'NetHack-3.7' of https://github.com/RainRat/NetHack into NetHack-3.7 2024-04-14 06:37:30 -04:00
nhmall f2d0dbcc09 revise alt_color_spec() so digit count limits work 2024-04-13 13:06:38 -04:00
nhmall 86cb8dba60 use COLORVAL macro in change_palette() 2024-04-13 12:09:45 -04:00
nhmall c30dbb2caa alt_color_spec follow-up 2024-04-13 12:00:37 -04:00
nhmall 936096d5e3 Windows build fix
consoletty.o : error LNK2005: _tty_change_color already defined in wintty.o
consoletty.o : error LNK2005: _tty_get_color_string already defined in wintty.o
2024-04-13 09:11:27 -04:00
nhmall 3364ac7cdb CHANGE_COLOR:allow #rrggbb hex color specification 2024-04-13 09:08:14 -04:00
nhmall ebd200ecc2 follow-up: preprocessor conditional 2024-04-12 21:59:59 -04:00
nhmall 15db874f71 CHANGE_COLOR palette option adjustments
It was too early to call the windowport change_color() routine
while processing the config file. The windowport was not yet
fully operational.

Now the palette option processing will just place the rgb
value into the appropriate ga.altpalette[CLR_MAX] entry.

init_sound_disp_gamewindows(void) [allmain.c] calls
change_palette() [coloratt.c] and it will call the windowport
change_color() function for each ga.altpalette[] entry that
has been set.

Notes:
The rgb values stored in ga.altpalette[] have the NH_ALTPALETTE bit set
so that the rgb value of 0 can be stored and be distinguishable from
a "not set" entry.

The NH_ALTPALETTE bit is cleared from the rgb value in change_palette()
prior to calling the windowport change_color() function.

The syntax for palette is colorname/r-g-b.
For example: palette:black/12-12-12

colorname must be one of the NH_BASIC_COLOR names or a suitable
alias for one of those 16 entries.

Some of the windowport CHANGE_COLOR functions had the wrong parameters,
perhaps due to bitrot. Those have been corrected to match the prototype.
2024-04-12 21:57:27 -04:00
nhmall 8bbbe38fb5 fix garbled message on symset change from O menu 2024-04-11 20:24:38 -04:00
nhmall 16c693eedf fix lingering error on Windows nmake command line build
src\cmd.c(3453) : warning C4701: potentially uninitialized local variable 'func' used
src\cmd.c(3453) : error C4703: potentially uninitialized local pointer variable 'func' used
2024-04-11 12:23:56 -04:00
nhmall 46370fc124 another follow-up: move values that can't be indexes
Move the values that are not legal mons indexes out of the default
handling case in make_corpse().
2024-04-10 11:34:41 -04:00
nhmall 125208d30b follow-up bit to explit mon entries in make_corpse() 2024-04-10 11:29:31 -04:00
nhmall a85cd7d5c8 let compiler catch missing additions during development
Take advantage of the ability of some compilers to warn if
not all values are covered in a switch statement, to draw
attention to the need to update make_corpse() when new
monsters are added to NetHack.

This adds explicit entries for the current "default" handling
in make_corpse().

It might be a good idea to review the explicit entries to see
if any of them represent others that are not being handled,
but should be.

To test this, I temporarily reverted 85c86444, and I did receive the
following warning:

mon.c:545:13: warning: enumeration value 'PM_GOLD_DRAGON' not handled in switch [-Wswitch]
  545 |     switch (mndx) {
      |             ^~~~
1 warning generated.
2024-04-10 11:07:40 -04:00
nhmall 5294b0a320 follow-up comment wording 2024-04-07 17:22:03 -04:00
nhmall b573538253 fix reported segfault during configfile processing 2024-04-07 13:14:12 -04:00
nhmall 080c6747fd follow-up bit
minor, but inner loop assignments to glyph and mapsym
are only needed when corr_next2u is TRUE
2024-04-04 16:51:51 -04:00
nhmall 1487d05c92 resolve 3 warnings during DOS cross-compile
wizcmds.c: In function 'wiz_custom':
wizcmds.c:1845:40: warning: format '%d' expects argument of type 'int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
 1845 |         Sprintf(bufa, "%s: colorcount=%d %s", wizcustom, iflags.colorcount,
      |                                       ~^                 ~~~~~~~~~~~~~~~~~
      |                                        |                       |
      |                                        int                     uint32_t {aka long unsigned int}
      |                                       %ld
wizcmds.c: In function 'wizcustom_callback':
wizcmds.c:1895:32: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32' {aka 'long unsigned int'} [-Wformat=]
 1895 |             Sprintf(bufc, "%011x", cgm->customcolor);
      |                            ~~~~^   ~~~~~~~~~~~~~~~~
      |                                |      |
      |                                |      uint32 {aka long unsigned int}
      |                                unsigned int
      |                            %011lx
wizcmds.c:1899:37: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32' {aka 'long unsigned int'} [-Wformat=]
 1899 |                 Sprintf(bufu, "U+%04x", cgm->u->utf32ch);
      |                                  ~~~^   ~~~~~~~~~~~~~~~
      |                                     |         |
      |                                     |         uint32 {aka long unsigned int}
      |                                     unsigned int
      |                                  %04lx
2024-04-03 12:15:51 -04:00
nhmall 40e3b3b64a doc update VIEWDEPRECATIONS=1 2024-04-01 15:12:28 -04:00
nhmall d0c543748e follow-up: use VIEWDEPRECATIONS instead of KEEPDEPRECATIONS 2024-04-01 15:04:07 -04:00
nhmall 61252f5c02 allow KEEPDEPRECATIONS=1 on make command line to see what's deprecated 2024-04-01 14:59:41 -04:00
nhmall 459f5f77c1 pass NETHACK_VERSION to package subproject 2024-04-01 09:24:09 -04:00
nhmall 69ecd69871 follow-up re: vs2017 2024-03-31 21:38:57 -04:00
nhmall 410c1b6cbd stop support & testing of nearly 7 year old vs2017 2024-03-31 21:31:34 -04:00
nhmall 0a4f9de695 follow-up: remove explicit Windows SDK reference 2024-03-31 20:43:15 -04:00
nhmall 1d4aeb4f15 add some zip file packaging to visual studio proj 2024-03-31 20:37:56 -04:00
nhmall 6f3a54367e follow-up to fix the git mv done earlier 2024-03-31 14:06:05 -04:00
nhmall e00e423262 remove leading period from Windows template file 2024-03-31 13:53:48 -04:00
nhmall 5ee813091a remove specific Windows 10 sdk reference 2024-03-31 12:01:05 -04:00
nhmall f71b0caecd visual studio project updates 2024-03-31 10:21:08 -04:00
nhmall 8262eb2fe4 add fetch 2024-03-31 09:09:31 -04:00
nhmall a3e9c7db2d follow-up: shorten some lines; add an assert 2024-03-31 08:28:50 -04:00
nhmall 8ccd8b8937 fix reported segfault in add_custom_nhcolor_entry()
Program terminated with signal SIGSEGV, Segmentation fault.
77      ../sysdeps/x86_64/multiarch/strlen-evex.S: No such file or directory.
(gdb) bt
    at glyphs.c:419
    at glyphs.c:173
    op=0x5a34af30a574 "DECgraphics") at options.c:3418
2024-03-31 08:06:42 -04:00
nhmall a1a1049890 follow-up for an apparent conflict in Qt5 2024-03-29 16:10:33 -04:00
nhmall af3a0db083 onefile fix 2024-03-29 07:02:04 -04:00
nhmall b4cd1d6ee0 remove unnecessary paragraph 2024-03-28 10:09:59 -04:00
nhmall c80bb1990d some Windows build doc updates and typo fixes 2024-03-28 10:06:08 -04:00
nhmall 9955b2364b update sys/windows/Install.windows 2024-03-27 16:44:40 -04:00
nhmall 5355ee67e2 follow-up: fix copy-and-paste error 2024-03-27 16:25:33 -04:00
nhmall bb2fef0f7d rework Windows build instructions 2024-03-27 16:20:06 -04:00
nhmall 1864480522 get rid of a [-Wformat-overflow=] warning 2024-03-26 08:25:32 -04:00
nhmall 66f92ad182 startup sequence and iflags values
early_init() calls decl_globals_init() which zeros out
a number structures:
    ZERO(flags);
    ZERO(iflags);
    ZERO(a11y);
    ZERO(disp);
    ZERO(u);
    ZERO(ubirthday);
    ZERO(urealtime);

Setting values in any of those during startup prior to
the early_init() call was futile, and the values would
get overwritten.

Such was the case with the setting of iflags.colorcount
during Windows startup, so do it after early_init() has
been called.
2024-03-25 22:30:08 -04:00