Commit Graph

16653 Commits

Author SHA1 Message Date
nhkeni
fabbb491e8 Avoid a complaint from GCC's analyzer. Patch from Pat. 2024-03-15 20:46:10 -04:00
nhmall
3b75501937 get rid of a couple of warnings if -Wassign-enum is used
symbols.c:429:7: warning: integer constant not in range of enumerated type 'enum symparse_range' [-Wassign-enum]
  429 |     { 0, 0, (const char *) 0 } /* fence post */
      |       ^
windows.c:1765:32: warning: integer constant not in range of enumerated type 'enum from_core_requests' [-Wassign-enum]
 1765 |                              { 0, 0, { NO_COLOR, ATR_NONE }}};
      |                                ^
2024-03-15 16:24:49 -04:00
nhmall
79648c6ce2 some variables not referenced in another translation unit made static
Also adds some cross-refence comments for some variables that are
referenced in another translation unit.
2024-03-15 16:00:14 -04:00
Pasi Kallinen
243f6410d2 Curses: simplify color handling
The map frame (background) colors were all over the place; the
code should be much cleaner now, and still work exactly the same
as before.

I tested this with terminals with 8, 16, and 256 COLORS.
2024-03-15 20:36:56 +02:00
nhkeni
96a74ccfbf Silence a compiler warning in cross-compile 2024-03-15 14:05:14 -04:00
Pasi Kallinen
464d0c9269 Curses: swap the grey and no-color initialization
The grey color was initialized as default foreground color,
and no-color as white.
2024-03-15 11:06:44 +02:00
nhkeni
ab6d7cdc3b depend.awk: bugfix for commented out replacement text 2024-03-13 22:04:19 -04:00
nhmall
31a8b44312 fix error in copied dependencies from Makefile.src 2024-03-13 20:29:40 -04:00
nhmall
2911596c5b sys/windows/Makefile.nmake dependency update
Copy the dependencies from the tail of sys/unix/Makefile.src
and adjust them for the Windows nmake build.
2024-03-13 20:10:34 -04:00
nhmall
d80352a983 warning fix read.c
read.c:148:13: warning: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Wstring-concatenation]
  147 |         "Ms. Palm's House of Negotiable Affection--A Very Reputable"
      |
      |                                                                     ,
  148 |             " House Of Disrepute",
      |             ^
read.c:147:9: note: place parentheses around the string literal to silence warning
  147 |         "Ms. Palm's House of Negotiable Affection--A Very Reputable"
      |         ^
1 warning generated.
2024-03-13 19:09:26 -04:00
PatR
9ee55d87eb fix pull request #1223 - wand of striking by monst
Pull request by elunna with assistance by entrez tried to fix up
wand of striking discovery when the wand is zapped by a monster.

The fix didn't match the intended behavior (which may or may not be
the desired behavior...), so this skips the code in the pull request.
[I can't post comments on github anymore since I declined to switch
to their 2-factor authentication.  But I can still read submissions
without logging in.]

This also tries to fix a couple of inconsistencies between zapping
by the hero versus by a monster.  If the zap "boinged" :-) due to
target's magic resistance, zap by hero didn't discover the wand but
zap by monster did.  Conversely, a zap by the hero that reached a
target and missed did discover it but one by a monster did not.

Now a zap of not-yet-discovered wand of striking by the hero which
hits, whether or not the hit gets resisted, will become discovered
provided that the spot where target is hit can be seen (the target
itself need not be), and one which misses or which can't be seen
hitting something will no longer be.

Supersedes #1223
Closes #1223
2024-03-13 13:28:05 -07:00
PatR
ff82541b74 comment typo fix... 2024-03-13 13:04:05 -07:00
PatR
2006ec6ca3 read.c bits
Add a comment to seffects_remove_curse().  Also shorten a handful of
wide lines.
2024-03-13 12:41:41 -07:00
PatR
68312f7feb magic trap uncursing vs scroll of remove curse
Reported directly to devteam:  if a magic trap gave its uncurse
effect, scroll of remove curse could become discovered.

Turns out that it would happen if hero was wielding a stack of
unholy water potions.  It didn't matter whether they were known
as water or known to be cursed or whether hero was carrying any
scrolls of remove curse.
2024-03-13 12:39:50 -07:00
nhmall
a13b9da286 Makefile.mingw32 update
$(HLHACKLIB) was missing from the dependency list for NetHack.exe
2024-03-12 17:27:21 -04:00
nhmall
dcc6890cee hacklib comment bit 2024-03-12 16:54:49 -04:00
nhw_cron
2d3eb0da0b This is cron-daily v1-Dec-5-2024. 000files updated: Files 2024-03-12 16:53:50 -04:00
nhmall
14c139746d yet more disabled code removal 2024-03-12 16:39:23 -04:00
nhmall
629badfbd9 more code cleanup
remove disabled code from makedefs.c because it uses a function in hacklib
now.
2024-03-12 16:18:23 -04:00
nhmall
a11898bef5 some code cleanup following recent code relocations 2024-03-12 16:13:33 -04:00
nhmall
2fae2b1a25 update tested versions of Visual Studio 2024-03-12 2024-03-12 15:23:04 -04:00
PatR
6ca54852ee perm_invent initialization fix
Using
|OPTIONS=windowtype:Foo
|OPTIONS=perm_invent
or
|NETHACKOPTIONS='perm_invent,windowtype:Foo'
would enable perm_invent if interface "Foo" supported it, but using
|OPTIONS=perm_invent
|OPTIONS=windowtype:Foo
or
|NETHACKOPTIONS='windowtype:Foo,perm_invent'
or combined
|OPTIONS=perm_invent
|NETHACKOPTIONS='windowtype:Foo'
would only enable perm_invent if both "Foo" and the default interface
supported it.

Using '--windowtyp:Foo' on the command line didn't have this issue
because command line interface selection replaces the default one
before configuration file and environment options are processed.
2024-03-12 11:19:35 -07:00
nhmall
f9f9641fd4 typo fix README-hints 2024-03-12 13:02:19 -04:00
nhmall
605c6c19b6 add a doc outlining some .370 hints file build options 2024-03-12 12:30:57 -04:00
nhmall
66ce95a034 Cross-compiling update
mips
2024-03-12 11:55:11 -04:00
nhmall
bb4bcb400e cross-compiling update 2024-03-12 10:06:37 -04:00
PatR
1922dd96eb theme room vampire fix
From a reddit thread:  a 'mausoleum' theme room picked a vampire for
its occupant and applied the wait-for-you strategy to it.  Hero's ESP
or monster detection showed a meditating vampire bat.  Change monster
creation by the special level loader (which also handles theme rooms)
to force such a creature into its normal vampire form.

That revealed an older bug which wouldn't have been exercized prior
to theme rooms:  a meditating vampire could and would shape change
without ceasing meditation.  Make it not shape change rather come out
of its trance.
2024-03-11 17:40:01 -07:00
nhw_cron
51eea440dc This is cron-daily v1-Dec-5-2024. 000files updated: Files 2024-03-11 17:32:31 -04:00
nhw_cron
2d1c1f03cb This is cron-daily v1-Dec-5-2024. 005guidebook updated: doc/Guidebook.txt 2024-03-11 17:31:32 -04:00
nhmall
bed6747342 line-length follow-up bit 2024-03-11 12:02:47 -04:00
nhmall
2bece65394 README update 2024-03-11 11:59:59 -04:00
nhmall
33ea32dbe3 warning fix in end.c 2024-03-11 11:41:26 -04:00
nhkeni
4e11d526da Show only active .c.o commands; clean up temp file from make depend 2024-03-10 21:53:33 -04:00
nhkeni
faeb6285e7 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-03-10 19:54:25 -04:00
nhkeni
0edfb577f7 Two more bug fixes:
split depend target so "make depend" and "make updatedepend"
 get the right dependencies (this puts back the previously
 temporarily removed dependencies)

deterministically pull out the right source so moc rules
 are correct
2024-03-10 19:51:55 -04:00
nhkeni
2980c55f5c report.c: silence some compiler warnings for clang + nhmd4 2024-03-10 19:51:55 -04:00
nhkeni
eba390f1cb Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-03-10 18:36:10 -04:00
nhkeni
998240d5f5 remove gmake-specific code from Makefile.src
The awk script for NOSTATICCORE is currently broken.
2024-03-10 18:35:19 -04:00
nhkeni
a9494b1385 report.c: silence some compiler warnings for clang + nhmd4 2024-03-10 17:36:51 -04:00
nhkeni
387b145b58 more fixes
removal of depend target dependencies is temporary
2024-03-10 16:23:20 -04:00
nhkeni
917c574537 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-03-10 16:17:26 -04:00
nhkeni
ae82f6494e bug fixes 2024-03-10 15:46:20 -04:00
nhkeni
7d2362c98d hack: put back recent make depend output until I can fix whatever I just broke 2024-03-10 12:51:11 -04:00
nhkeni
c747f2af9c test run of updatedepend 2024-03-10 10:41:16 -04:00
nhkeni
7ad921ebe7 Merge branch 'keni-pending2' into NetHack-3.7 2024-03-10 10:36:24 -04:00
nhkeni
f065cb4ec7 Merge branch 'keni-regex' into NetHack-3.7 2024-03-10 10:22:19 -04:00
PatR
3e2999d3e6 refine walking on ice might slip in random dirctn
If moving on ice causes the hero to hurtle an extra step in a random
direction, don't allow that to be backward to where hero started.

Also, if hero is in grid bug form, only allow hurtling forward.
It was allowing slips in a diagonal direction, which seems wrong
for grid bug, and even when it slipped in an orthogonal direction,
buffered screen updating made the combined step+hurtle appear to be
a single diagonal step.

I'm not a fan of this seemingly simple change.  The hurtle/second
step comes after the "you slip on the ice" vs "you slip off the ice"
messaging and might put the hero in a location which contradicts it.
2024-03-09 16:05:11 -08:00
Pasi Kallinen
6e6c8a7208 Curses: fix message window border
When certain options (eg. legacy at least) were turned off,
the curses message window wasn't redrawn after the character creation.
2024-03-09 22:58:28 +02:00
nhkeni
a22ed4f232 depend.awk changes
- sort the dependencies
- sort the rules
- the above can be disabled in the BEGIN block
- usage documentation changes for next commit
2024-03-09 15:23:15 -05:00
nhkeni
79867d78c8 Two new features primarily in Makefile.src:
NOSTATICCORE - an option for Linux to get a better backtrace
updatedepend - an easier alternative to "make depend"

- .gitignore: ignore new temporary .*.c files
- hints/linux.370: add NOSTATICCORE and instructions
- Makefile.src:
-- If NOSTATICCORE defined, run core .c files through awk to
   remove static attribute from functions.
-- add updatedepend target and related bits
2024-03-09 15:16:24 -05:00