Commit Graph

16572 Commits

Author SHA1 Message Date
nhmall
eb294ef4e1 Files update from cron job 2024-03-03 18:47:10 -05:00
nhmall
6619d10d90 ENHANCED_SYMBOLS: store all CLR_ colors specially
The 0x1000000 bit (NH_BASIC_COLOR bit) was used to mark
CLR_BLACK when storing it in u->ucolor. Now, all of the basic CLR_*
colors are stored that way.

The NH_BASIC_COLOR bit indicates that the value in u->ucolor is
not an rgb value, rather it is one of the 0-15 basic NetHack colors.
The window-ports need to strip the NH_BASIC_COLOR bit off before using
it for color changes.
2024-03-03 18:31:11 -05:00
nhmall
3fb35e390b visual studio project file update 2024-03-03 14:35:55 -05:00
nhmall
02074d7461 Windows Makefile updates 2024-03-03 14:15:53 -05:00
nhmall
dbea5d8684 shorten options.c a little by moving some color stuff out of it
creates new coloratt.c file

Also, this attempts to fulfill a wish-list item by paxed, to
allow naming colors in symbols file by name as an alternative
to using r-g-b values.  The basic color names as well as html
color names are supported.
2024-03-03 14:11:17 -05:00
Patric Mueller
fb353fff6c Add NULL pointer guards for the crash reports variables
Calling sprintf with NULL string for a %s format identifier seems to be
undefined behavior.  I got some semi persistent crashes while calling
the extend options menu with mO.
2024-03-03 16:14:15 +01:00
Pasi Kallinen
53778ee507 Use single define for max message history
... instead of having every windowport define their own variant.
Affects tty, curses, X11, and Windows GUI.
2024-03-03 11:34:59 +02:00
PatR
9a866688c5 engravings shown with symset:blank
Noticed when testing the OPTIONS=symset:blank fix, map spots holding
engravings weren't blank.

Are there any other relatively recently added symbols that need to be
added to the blank set?
2024-03-02 06:12:34 -08:00
PatR
5e79f8c425 fix #K4113 - OPTIONS=symset:blank in RC file
Any plain text symbol set specified in .nethackrc or NETHACKOPTIONS
didn't get loaded but did set the symset name.

Faulty 'if' logic excluded loading of symbol sets that used the
default handling type of H_UNK.
2024-03-02 05:50:44 -08:00
Pasi Kallinen
140fb7215d Message location for monster going thru trap door 2024-03-02 10:00:38 +02:00
Pasi Kallinen
8588873858 Item destruction and recharging fix
Recharge only handles items carried by hero.
I don't think it really matters that we just skip it, but leave
a FIXME in the code if anyone has enough energy to improve this later.
Fallout from the unified item destruction.
2024-03-02 09:29:55 +02:00
nhkeni
ad667216ee Prevent conflicting types for name "body" 2024-03-01 16:19:30 -05:00
nhmall
d4dabbfa8d update tested versions of Visual Studio 2024-03-01 2024-03-01 09:33:00 -05:00
nhmall
c6124585db Onefile bit 2024-03-01 09:30:21 -05:00
PatR
a26ad241b2 'showvers' warning fix for curses
The wishy-washy warning for case BL_VERS was "may fall through" when
it always fell through, and there was no mention of the fact that the
assignment had no effect because it was immediately overwritten by
similar assignment for the fall through cases.

It may have 'spacing = 2' rather than 1 at some point, but since that
field is right justified it wouldn't make any difference.
2024-02-29 23:50:35 -08:00
PatR
193085d2e3 'showvers' vs 'O'
Don't include the new 'showvers' option in the short 'O' menu.

optlist.h doesn't start with the usual line with substitutable fields
but I haven't attempted to amend that.
2024-02-29 13:05:54 -08:00
Pasi Kallinen
121cf75d39 Minor changes to mention_map
Disable it during screen redraw.
Always use the message coordinates with it, even if accessiblemsg is off.
2024-02-29 18:29:43 +02:00
nhkeni
acf60063d5 Add missing prototypes for static functions to avoid warnings. 2024-02-29 10:49:53 -05:00
nhmall
356875ea20 updates from cron daily 2024-02-29 09:03:00 -05:00
nhmall
258d7b2f56 Guidebook date stamp 2024-02-29 08:00:19 -05:00
nhmall
92f831d53a do not include tmac.n
The terms of use listed in doc/tmac.n ask that it not be modified from
the original.
.
2024-02-29 07:40:19 -05:00
RainRat
a3658f85ac fix typos 2024-02-28 20:15:56 -08:00
nhmall
b53a43027f generic obj addition broke obj entity count use
yet another EDITLEVEL bump
2024-02-28 16:24:40 -05:00
nhmall
3edd3e5869 catch invalid id on restore
Another EDITLEVEL bump.
2024-02-28 16:15:30 -05:00
nhmall
1a02a2df16 purge a couple of placeholders from context struct
Take advantage of today's EDITLEVEL bump, and add yet another to
remove some field placeholders left behind in when two fields were moved
elsewhere in 22e52ee9.
2024-02-28 15:54:34 -05:00
PatR
41a5565403 new 'showvers' option
Add options 'showvers' (boolean) and 'versinfo' (numeric mask) to
show nethack's version on the status lines during play.  It won't be
particularly interesting to ordinary players but should be useful
when making screenshots or video to be streamed, or for someone who
switches between git branches or between nethack and variants.

I worked on this several months back but it was combined with
unfinished changes to 'hitpointbar'.  I've separated it out so that
it can be put into use.  When enabled, one or more components of
"<name> <branch> <version>" will be shown right justified after
status conditions.  At present the default is "<branch>" if that is
available and overall status isn't 'released', or "<version>" if
'released' or if branch isn't available.  That might need some
refinement.

It works as intended for tty and curses, although some abbreviation
mechanism would be useful if/when the program resorts to abbreviating
status conditions to make things narrow enough to fit.

For X11, it works ok for fancy_status:True (the default, controlled
via NetHack.ad settings) but is messed up for tty-style status.  The
text is positioned correctly but there are gaps in it, making it
appear garbled, similar to what I saw when I tried and failed to
implement statuslines:3 for X11.  [It might be due to having empty
condition widgets be 1 pixel wide instead of being totally removed
but I don't think the situation is that simple.]

For Qt, if the text needs to be truncated in order to fit, the center
portion of the string will be shown, discarding parts from the left
and right.  That ought to discard from left and retain rightmost
portion instead.

For win32|mswin|Win GUI, no attempt to support it has been included.
Things should be ok when 'showvers' is left as False (the default)
but I don't know what will happen if that gets toggled to True.  At a
minimum, the version info won't be right justified.  The information,
or at least some of it, is displayed in the game window's title bar
so there isn't any pressing need to add it to status, but toggling
the option will need to behave sensibly if it doesn't already.
2024-02-28 11:47:16 -08:00
nhkeni
5c3fd7b485 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-02-28 14:06:33 -05:00
nhkeni
cd1002f84e DEVEL: add directions for a Linux credential helper 2024-02-28 14:05:23 -05:00
Pasi Kallinen
25fa293c81 Accessibility: lookaround command, mention_map option
Adds a new extended command #lookaround, which will describe
the map around the hero they can see or remember.

Adds a new boolean option mention_map, which will give a message
when an interesting map location in sight changes.
2024-02-28 20:53:52 +02:00
PatR
1532a052c0 spellbook of blank paper named Making Money
Reported directly to devteam, polymorphing a spellbook could produce
a blank spellbook with a Discworld novel's title attached.
2024-02-27 11:27:02 -08:00
nhmall
334535e7b0 Fix makemon() trying to generate a monster on top of another monster
When makemon was called with all-zero arguments (e.g. for random
monster generation over time), ptr==NULL means "a random monster".
This was being forwarded to mon==NULL in makemon_rnd_goodpos, and
then mtmp==NULL in goodpos, which means "an object, not a monster".
Because objects can be generated under monsters, this meant that an
attempt to create a random monster could end up choosing a location
that already had a monster, which would then cause the monster
generation to fail.

This mostly wasn't noticeable in normal play: it effectively
reduced the monster generation rate depending on how many locations
outside LOS happened to contain a monster. Normally that's a very
small proportion, so the bug had no obvious effects: but when there
are very few locations outside LOS (i.e. the player can see almost
every location on the level), the bug effectively caused monster
generation to stop once those locations became occupied by
non-moving (e.g. hiding) monsters, something that became observable
in games where the player decided to dig out and light almost an
entire level.

This commit fixes the problem by adding a new flag to goodpos that
requests that it not choose a position that already has a monster.

This bug was diagnosed, and this fix committed, by ais523; but
nhmall wrote almost all of the code implementing the fix.
2024-02-27 19:04:35 +00:00
PatR
1d26f80ccf more nhmd4.c formatting
Insert a space between cast operator and target.

For 'x | y' expression spanning multiple lines, split with bitwise OR
operator at the beginning of second line instead at the end of first.

I changed a macro that was expanding to 'expr_1; expr_2' into
'(expr_1, expr_2)'.  Both expressions modify arg 'a' which would be
a no-no within a single expression, but the comma operator provides a
sequence point that guarantees that the first expression will be fully
evaluated with side-effects--assignment to 'a'--completed before the
second one starts, making both assignments be well defined.
2024-02-26 11:46:03 -08:00
PatR
5acb82640d update a getpos() comment
Not a typo this time; the highlight-valid-position callback interface
was simplified.
2024-02-25 12:36:19 -08:00
PatR
53f16f9e8c reformat nhmd4.{c,h} 2024-02-24 13:49:51 -08:00
Pasi Kallinen
dd37c5326a Accessibility: showdamage option
Add a new boolean option showdamage, if on, outputs a message
like "[HP -2, 14 left]" - several variants have something similar,
but I chose the message based on how eSpeak said it, while keeping
it short.
2024-02-24 17:38:46 +02:00
PatR
9927e264b5 hacklib.c NONNULL functions
A bunch of routines return a pointer which is never Null but weren't
telling the compiler that such was the case.  A couple (strsubst(),
stripchars()) were accepting Null output argument and then returning
Null, but callers had no reason to use them that way, so they've been
changed.  (upstart() could have been changed similarly; I've already
forgotten why I left it as-is.)
2024-02-23 20:02:01 -08:00
nhkeni
5f64dd3f1b Make initoptions() call initoptions_init() if that hasn't already happened. 2024-02-23 20:14:03 -05:00
nhkeni
77916d5d73 make depend for previous commit 2024-02-23 18:04:26 -05:00
nhkeni
eadebf0132 Use local md4 implementation instead of libcrypto for linux.
NB: "make depend" needs to be rerun
2024-02-23 17:08:49 -05:00
nhkeni
61f4d972bb Add local md4 implementation and drop libcrypto for linux. 2024-02-23 17:05:45 -05:00
nhmall
353838c1a6 follow-up to nethackw.exe vertical menu row adjust
Commit 7e452018a6 resolves #1094
2024-02-23 09:41:53 -05:00
nhmall
7e452018a6 Windows GUI: vertical menu row spacing for tiles
The menus in nethackw.exe were being spaced according to the vertical
tile size of custom tiles, but the tiles were being rendered in menus
at the default size anyway, resulting in unnecessary gaps between menu
rows.

Use the default size of 16 for the vertical spacing calculation.
2024-02-23 09:32:50 -05:00
nhmall
4478200964 update tested versions of Visual Studio 2024-02-22 2024-02-22 15:03:13 -05:00
PatR
cba7e6eb43 umpteenth comment typo fix
plus bonus fix:  change a recent fixes entry to past tense.
2024-02-22 11:01:53 -08:00
PatR
9f7fffc823 rolling boulder trap fix
The recent "trap.c reformatting" commit included a non-formatting
change switching from gb.bhitpos.x,.y to local x,y in the rolling
boudler trap routine.  The part of that routine used when a rolling
boulder hits another boulder and transfers its remaining momentum
to that other one got switched to wrong x,y and the first boulder
basically kept going, possibly hitting itself at each new position.
2024-02-22 11:00:18 -08:00
nhkeni
7e08ce3e9e Merge branch 'keni-crdumplog' into NetHack-3.7 2024-02-21 16:27:52 -05:00
Pasi Kallinen
c7e2ebe83c Check inventory protection only when hero is carrying it
TODO and better fix would be to have similar check for
monster inventory.
2024-02-21 11:28:49 +02:00
Pasi Kallinen
d42efcd04f Slightly randomize the spellbook in vlad's tower
Replace the guaranteed invisibility with a somewhat high-level
spell sort-of thematical to Vlad or vampires in general
2024-02-21 09:47:47 +02:00
Pasi Kallinen
391295cfdc Move comment 2024-02-21 08:18:40 +02:00
nhkeni
3f5d1d3a36 split DUMPLOG
DUMPLOG requests the DUMPLOG feature as it does now
DUMPLOG_CORE requests the internal buffering only (used for CRASHREPORT)

This allows CRASHREPORT to access recent messages without performing
any file I/O.
2024-02-20 21:42:05 -05:00