]> granicus.if.org Git - nethack/log
nethack
2 years agoexpand some 'struct obj' comments
PatR [Wed, 23 Nov 2022 08:46:30 +0000 (00:46 -0800)]
expand some 'struct obj' comments

2 years agoonbill() fix
PatR [Wed, 23 Nov 2022 08:21:04 +0000 (00:21 -0800)]
onbill() fix

Fix a typo/thinko pointed out by entrez.

2 years agomore unix command line: -?
PatR [Wed, 23 Nov 2022 07:55:41 +0000 (23:55 -0800)]
more unix command line: -?

The fix for 'u Name' earlier today broke '-?'.

2 years agoUnix: fix 'nethack -u name'
PatR [Tue, 22 Nov 2022 22:53:43 +0000 (14:53 -0800)]
Unix: fix 'nethack -u name'

Using '-u name' rather than '-uname' was being treated as '--usage'
for any value of 'name'.

'-uname' worked as intended unless name was 'sage' (or leading
substring of it).  That's still the case after this fix, where the
space after -u is now necessary for that special case name.

2 years agoextend sanity_check to shop items
PatR [Mon, 21 Nov 2022 21:16:51 +0000 (13:16 -0800)]
extend sanity_check to shop items

Make object sanity checks examine obj->unpaid and obj->no_charge.

Shopping is complicated; there might be corner cases that aren't
handled correctly.

2 years agoQt pager doll inventory
PatR [Mon, 21 Nov 2022 20:53:42 +0000 (12:53 -0800)]
Qt pager doll inventory

Change Qt's 6x3 grid of worn/wielded equipment so that it is facing
the player: hero's right hand side is shown in the grid's left column
and left hand side is shown in its right column.  Middle column is
unchanged.

2 years agoanother man page revision
PatR [Sun, 20 Nov 2022 01:03:26 +0000 (17:03 -0800)]
another man page revision

Add new '--usage' and '--help'.
Add missing '--nethackrc:RC-file' and '--no-nethackrc'.
Explain -D and -X more precisely.
Reorder the options to manually produce a synopsis section that looks
like

"  nethack [ -d|--directory directory ] [ -w|--windowtype interface ]
"  [ --nethackrc:RC-file | --no-nethackrc ] [ -n ] [ -dec | -ibm ]
"  [ -u playername ] [ -X | -D ] [ -p profession ] [ -r race ] [ -@ ]
"
"  Also [ -A|-Arc | -B|-Bar | -C|-Cav | -H|-Hea | -K|-Kni | -M|-Mon |
"  -P|-Pri | -R|-Rog | -Ran | -S|-Sam | -T|-Tou | -V|-Val | -W|-Wiz ]
"
"  nethack [ -d|--directory directory ] -s|--scores [ -v ]
"  [ -p profession ] [ -r race ] [ playernames ]
"
"  nethack [ --usage | --help ] [ --showpaths ] [ --version[:paste] ]

to avoid instances of line breaks like "...[\n-foo ]..." and
"...[ -bar\n]...".  With TeX it would be straightforward to favor line
breaks in front of "[" and after "]" but I don't know whether or how
'roff can do that.

2 years agofixes entry for PR #928 - remove '#if LINT'
PatR [Sat, 19 Nov 2022 08:50:36 +0000 (00:50 -0800)]
fixes entry for PR #928 - remove '#if LINT'

Pull request from argrath:  remove a bunch of '#ifdef LINT' code
snippets that no longer serve any useful purpose.

If a lint that handles C99 is ever produced, persumably it won't
need the fairly ridiculous hacks for 'static' and 'long'/'long *'.

Closes #928

2 years agoremove the code to silence lint
SHIRAKATA Kentaro [Thu, 17 Nov 2022 09:34:37 +0000 (18:34 +0900)]
remove the code to silence lint

Warning facilities on recent compilers are incredibly improved,
so the code to silence "good-old" lint is much less sense.

2 years agopull request #927 - charging vs undiscovered tools
PatR [Sat, 19 Nov 2022 08:43:16 +0000 (00:43 -0800)]
pull request #927 - charging vs undiscovered tools

Pull request from entrez:  don't list undiscovered or unseen (picked
up while blind, still blind) tools as likely candidates for charging.
They're still eligible to be chosen for charging but using a scroll
to charge something else won't reveal not-yet-known tools as being
magic.

Fixes #927

2 years agoDon't leak ID of magic tools in charging prompt
Michael Meyer [Wed, 16 Nov 2022 20:40:16 +0000 (15:40 -0500)]
Don't leak ID of magic tools in charging prompt

The getobj prompt for charging was presenting any chargeable tool in the
hero's inventory as a suggested charging target, even tools which were
unidentified and undistinguishable from their mundane counterparts
(e.g. bag of tricks, magic harp, horn of plenty...).  This leaked
information about the identity of these items and made it possible to
determine whether a generic 'harp' was magic or not.

When suggesting chargeable tools, include only those which are actually
known to be chargeable (unidentified or unseen chargeable tools can
still be selected, they just won't be suggested targets).  Basically the
same as what's done for a potion of oil in the apply prompt.

2 years agotweak PR #925 - don't expose shop bill details
PatR [Sat, 19 Nov 2022 08:38:20 +0000 (00:38 -0800)]
tweak PR #925 - don't expose shop bill details

Avoid use of 'struct bill_x' outside of shk.c.

2 years agofixes entry for PR #925 - shop boulders
PatR [Sat, 19 Nov 2022 08:15:23 +0000 (00:15 -0800)]
fixes entry for PR #925 - shop boulders

Pull request from entrez:  boulders owned by shops could be used up
(plugging hole in floor) or stolen (pushed through unrepaired gap in
shop wall) without cost.  Not very common because shops rarely have
boulders in them.

Fixes #925

2 years agoCharge hero for making off with shop-owned boulder
Michael Meyer [Mon, 14 Nov 2022 19:59:29 +0000 (14:59 -0500)]
Charge hero for making off with shop-owned boulder

Pushing a shop-owned boulder out of the shop wouldn't charge the hero
anything.  Remedy this (and remove the boulder from the bill if the hero
then pushes it back in).  Also tried to handle a couple other uncharged
boulder "theft" scenarios: pushing a boulder into lava or water, into a
trapdoor or hole, or into a level teleporter (various other traps
already charged for the boulder -- it was pretty inconsistent).

I externified onbill() for this, since relying on otmp->unpaid by itself
impossibles if you push a boulder through a gap in a wall between two
adjoining shops.

2 years agoPR #926 tweak - mdistu()
PatR [Sat, 19 Nov 2022 08:08:44 +0000 (00:08 -0800)]
PR #926 tweak - mdistu()

Define mdistu() in terms of distu() rather than dist2().  It's an
extra level of macro expansion when compiling but that's negligible
overhead.

2 years agogithub pull request #926 - mdistu()
PatR [Sat, 19 Nov 2022 07:45:32 +0000 (23:45 -0800)]
github pull request #926 - mdistu()

Pull request from entrez.  Replace instances of
distu(mon->mx, mon->my) with new mdistu(mon).

Closes #926

2 years agoAdd 'mdistu' macro
Michael Meyer [Mon, 14 Nov 2022 23:37:17 +0000 (18:37 -0500)]
Add 'mdistu' macro

Short for distu(mtmp->mx, mtmp->my) (i.e. the distance between the hero
and the specified monster), which is a very common use of distu().  The
idea is that this would be a convenient shorthand for it; I actually
thought it (or something very similar) existed already, but couldn't
find it when I tried to use it earlier.  Based on the number of uses of
fully-spelled-out 'distu(mtmp->mx, mtmp->my)' replaced in this commit
I'm guessing I just imagined it.

2 years agoFix: "a dry rattle comes from its throat"
Michael Meyer [Mon, 14 Nov 2022 23:25:15 +0000 (18:25 -0500)]
Fix: "a dry rattle comes from its throat"

"A dry rattle comes from its throat" would be printed whenever a
canceled monster tried to spit at you or another monster while not in
the hero's line of sight.  That seemed weird to me: you can't see the
monster and don't know what it is, but you can tell the sound is
definitely coming from "its throat".

Change the message if the monster isn't visible, and make sure it's
printed it only if the monster is nearby (within reasonable hearing
range for a "dry rattle").

2 years agocontrol of command-line usage entry in '?' menu
PatR [Sat, 19 Nov 2022 01:54:17 +0000 (17:54 -0800)]
control of command-line usage entry in '?' menu

Instead of using a compile-time macro to suppress inclusion of the
menu entry to show UNIX command-line usage in the help menu, use a
sysconf setting instead.

Default is HIDEUSAGE=0, to include the entry for command-line usage.
Set HIDEUSAGE=1 to exclude that.  Does not affect 'nethack --usage'
if player actually has access to the command-line.

2 years ago'nethack --usage' and '?' menu
PatR [Sat, 19 Nov 2022 00:07:15 +0000 (16:07 -0800)]
'nethack --usage' and '?' menu

Write up a description of how the command line works on UNIX and put
that in new file dat/usagehlp.  Add support for
|nethack --usage | --help | -? | ?
to display it and exit.

Also add a menu entry for nethack's help command to show it during
play.  That can be suppressed by uncommenting new '#define HIDE_USAGE'
in config.h since it won't be useful on servers that don't give
players access to command lines.

New genl_display_file() just writes to stdout.  opt_usage(), which
calls it, might need some suid/sgid handling to make sure the output
is done as the player rather than as nethack.

doc/nethack.6 is already out of date again.

2 years agoyet more nethack -s
PatR [Fri, 18 Nov 2022 00:37:45 +0000 (16:37 -0800)]
yet more nethack -s

For  nethack -s name1 [name2 [name3]]
allow any or all of the name arguments to be preceded by -u.  Both
'-u name1' and '-uname2' forms are accepted same as when specifying
character name at start of play.

It has been accepting '-s<anything>' and ignoring the <anything>.
Treat such as a separate argument instead.  That means it will accept
'-s-v' which is silly but if used intentionally, <anything> would most
likely be a name.

'nethack -s' without any character name(s) supplied and PERS_IS_UID
set to 0 now defaults to "all" instead of to "hackplayer".  For Unix,
the default name will be in place, so that gets used instead of "all".
'nethack -s all' or 'nethack -s -u all' can be used to see all scores.

When no matches are found, feedback is a full sentence but terminating
punctuation was omitted except for the special case of "Cannot find
any entries for you."  Add the final period all the time.

2 years agomore nethack -s
PatR [Thu, 17 Nov 2022 21:19:19 +0000 (13:19 -0800)]
more nethack -s

For Unix, set plname[] to the default value (player's username)
before running prscore() for 'nethack -s'.  Avoids reference to
mysterious "hackplayer" if no entries are found.

2 years agofix 'nethack --scores'
PatR [Thu, 17 Nov 2022 07:41:07 +0000 (23:41 -0800)]
fix 'nethack --scores'

The command line parsing in unixmain.c accepted --scores as an
alternative to -s but prscore() in topten.c didn't.

2 years agomanpage update
PatR [Wed, 16 Nov 2022 22:47:25 +0000 (14:47 -0800)]
manpage update

Add -w|--windowtype.

Also --scores and --directory as recognized variations of -s and -d.

Add -@.  The existing description of '-p @' seems to be inaccurate,
and random role but still having to supply race+gender+alignment
isn't very useful anyway.  The bit about maybe needing to quote @ with
backslash might still be useful if moved to -@ though.

Add -A|-Arc -B|-Bar ... -W|Wiz since they hadn't been listed.  I put
them on their own line instead of cluttering up the main program
invocation even further.

Move '-u character-name' before '-D' since that order matters on some
platforms.

Move --showpaths and --version to a separate command invocation since
combining them with any other stuff ends up ignoring that other stuff.
I didn't add --dumpenums.

The description of config file name and location under '-dec and -ibm'
is out of date, particularly for Windows.

2 years agoupdate tested versions of Visual Studio 2022-11-14
nhmall [Mon, 14 Nov 2022 17:56:06 +0000 (12:56 -0500)]
update tested versions of Visual Studio 2022-11-14

2 years agomove Makefile variable assignment
nhmall [Mon, 14 Nov 2022 05:22:32 +0000 (00:22 -0500)]
move Makefile variable assignment

2 years agofix path to djgpp c++ compiler in ms-dos cross-compile
nhmall [Mon, 14 Nov 2022 05:00:20 +0000 (00:00 -0500)]
fix path to djgpp c++ compiler in ms-dos cross-compile

2 years agosome follow-up for warnings experienced on macOS
nhmall [Mon, 14 Nov 2022 03:56:05 +0000 (22:56 -0500)]
some follow-up for warnings experienced on macOS

2 years agosome Makefile and hints tinkering
nhmall [Mon, 14 Nov 2022 03:25:07 +0000 (22:25 -0500)]
some Makefile and hints tinkering

1. remove all window interface bits from compiler.370, and have
   the preceding include files set some variables to control
   the behavior of compiler.370 when it comes to c++.
2. some more common Makefile lines into sys/unix/hints/include/multiw-3.370.
3. make it so you can pass cppregex=1 on the Make command line to build with
   sys/share/cppregex.cpp instead of posixregex.c
4. fix sys/share/cppregex.cpp so that it will build with clang compiler
   (required an additional header include). I don't know if it would have
   worked with g++ without that change. The include can be placed into an #ifdef
   block if there's an issue with the change on other compilers.
5. Anything that needs to compile using c++ (Qt, sys/share/cppregex.cpp) can
   just ensure that CPLUSPLUS_NEEDED Makefile variable is set above the lines
   in compiler.370 to ensure that things get set up for c++. It no longer
   checks specifically for Qt. That is what sys/unix/hints/include/multiw-2.370
   does now.

2 years agoreset X11's "interface has been initialized" flag
PatR [Sun, 13 Nov 2022 21:12:19 +0000 (13:12 -0800)]
reset X11's "interface has been initialized" flag

Reset 'x_inited' after the various widgets have been released
during shutdown.

This might prevent the second panic ('X11_mark_synch()' during
emergency save) in the double panic reported in a later comment of
github issue #569.  It definitely doesn't address whatever caused
the first panic, nor the poor handling of missing fonts that was
apparently responsible for #569's initial report.

2 years agowinX.c
PatR [Sun, 13 Nov 2022 20:43:34 +0000 (12:43 -0800)]
winX.c

Mostly reformatting, but also initialize all output arguments in
get_window_frame_extents() in case it makes an early return.

2 years agoThis is cron-daily v1-May-8-2022. 000files updated: Files
nhw_cron [Sun, 13 Nov 2022 17:24:08 +0000 (12:24 -0500)]
This is cron-daily v1-May-8-2022.  000files updated: Files

2 years agomultiw-3.370
nhmall [Sun, 13 Nov 2022 17:17:27 +0000 (12:17 -0500)]
multiw-3.370

Add a 3rd multi-window include file that comes after compiler.370.

Relocate a small section of Makefile lines common to both macOS.370
and linux.370 to multiw-3.370.

Also relocate a section near the tail of compiler.370 that really
has nothing to do with compilers or compiler flags, but was
related to Qt which is one of the supported multi-window interfaces.

2 years agostreamline defsym.h
PatR [Thu, 10 Nov 2022 23:44:53 +0000 (15:44 -0800)]
streamline defsym.h

Condense the setup of PCHAR/PCHAR2 and OBJCLASS/OBJCLASS2 (last one
renamed from OBJCLASS7) so that it's easier to see the variations
at once on an ordinary size terminal/window.  Revise some of the
indentation and other spacing, also to try to enhance readability
a little.

Unrelated:  remove a trailing space that crept in with a recent pull
request.

2 years agotypo
nhmall [Thu, 10 Nov 2022 17:22:13 +0000 (12:22 -0500)]
typo

2 years agoadd a note
nhmall [Thu, 10 Nov 2022 16:57:00 +0000 (11:57 -0500)]
add a note

2 years agoremove code on Windows referencing WIN32_GRAPHICS
nhmall [Thu, 10 Nov 2022 16:47:31 +0000 (11:47 -0500)]
remove code on Windows referencing WIN32_GRAPHICS

As far as I know, there's no such thing as WIN32_GRAPHICS in the
current source tree. The Windows graphical port uses the preprocessor
macro MSWIN_GRAPHICS.

2 years agoavoid use of variables near and far
nhmall [Thu, 10 Nov 2022 16:18:49 +0000 (11:18 -0500)]
avoid use of variables near and far

Some recent testing with a multi-platform compiler encountered difficulty
with the use of a variable 'near' (and presumably 'far', but we don't have
any of those in the source tree) due to reserved word extensions.

Avoid using that as a variable name.

2 years agopull request #922 - remove #ifdef GCC_WARN
PatR [Tue, 8 Nov 2022 20:09:50 +0000 (12:09 -0800)]
pull request #922 - remove #ifdef GCC_WARN

Pull request from argrath:  remove another instance of #if GCC_WARN.

Fixes #922

2 years agoremove GCC_WARN
SHIRAKATA Kentaro [Sat, 5 Nov 2022 11:56:55 +0000 (20:56 +0900)]
remove GCC_WARN

Now, the only usage of GCC_WARN is for the guard of PRINTF_F in wincurs.h.
This guard can be removed safely, as PRINTF_F is already used unconditionally in extern.h.

2 years agopull request #918 - level teleport target "delphi"
PatR [Tue, 8 Nov 2022 19:57:49 +0000 (11:57 -0800)]
pull request #918 - level teleport target "delphi"

Pull request from entrez:  treat "delphi" as a synonyn for "oracle"
when using a name rather than number for level teleport destination.

Fixes #918

2 years agoUse "delphi" as "oracle" levelport alias
Michael Meyer [Wed, 2 Nov 2022 14:21:51 +0000 (10:21 -0400)]
Use "delphi" as "oracle" levelport alias

Permit levelport by name to "delphi".  That is what the Oracle calls the
level (or at least her room) in-game, so it seems like a natural guess
for the name of the level.

2 years agokeep propertynames static in timeout.c
nhmall [Sun, 6 Nov 2022 15:02:27 +0000 (10:02 -0500)]
keep propertynames static in timeout.c

2 years agofollow-up bit to fixes3-7-0.txt
nhmall [Sat, 5 Nov 2022 23:40:23 +0000 (19:40 -0400)]
follow-up bit to fixes3-7-0.txt

2 years agowarning resolution
nhmall [Sat, 5 Nov 2022 23:36:46 +0000 (19:36 -0400)]
warning resolution

makedefs.c:100:6: warning: unused variable 'Dont_Edit_Code' [-Wunused-variable]
    *Dont_Edit_Code =
     ^
1 warning generated.

2 years agoMerge branch 'old-software-compatibility' of https://github.com/chasonr/NetHack into...
nhmall [Sat, 5 Nov 2022 23:30:20 +0000 (19:30 -0400)]
Merge branch 'old-software-compatibility' of https://github.com/chasonr/NetHack into NetHack-3.7

2 years agoadd fixes3-7-0.txt entry for pr923
nhmall [Sat, 5 Nov 2022 23:28:28 +0000 (19:28 -0400)]
add fixes3-7-0.txt entry for pr923

2 years agoMerge branch 'pr923' into NetHack-3.7
nhmall [Sat, 5 Nov 2022 23:26:50 +0000 (19:26 -0400)]
Merge branch 'pr923' into NetHack-3.7

2 years agoMerge branch 'unicode-X11-2' of https://github.com/chasonr/NetHack into pr923
nhmall [Sat, 5 Nov 2022 23:23:18 +0000 (19:23 -0400)]
Merge branch 'unicode-X11-2' of https://github.com/chasonr/NetHack into pr923

2 years agorelocate mstrength() and supporting function again
nhmall [Sat, 5 Nov 2022 22:40:57 +0000 (18:40 -0400)]
relocate mstrength() and supporting function again

Also, purge the code for makedefs -m

2 years agoSome cleanup for non-ENHANCED_SYMBOLS build
Ray Chason [Sat, 5 Nov 2022 22:34:44 +0000 (18:34 -0400)]
Some cleanup for non-ENHANCED_SYMBOLS build

2 years agoFree the font structure when done
Ray Chason [Sat, 5 Nov 2022 22:24:02 +0000 (18:24 -0400)]
Free the font structure when done

Also, adjust some comments about not supporting supplementary
characters.

2 years agoRevert "ranged_attk() - there can be only one"
nhmall [Sat, 5 Nov 2022 19:26:29 +0000 (15:26 -0400)]
Revert "ranged_attk() - there can be only one"

This reverts commit b399e3f2f5cb9ebed00e194511ec2cc7e056a796.

2 years agoranged_attk() - there can be only one
nhmall [Sat, 5 Nov 2022 17:07:10 +0000 (13:07 -0400)]
ranged_attk() - there can be only one

Relocate the newer code for the function to mdlib.c
where makedefs can still use it.

2 years agoprefix static version of ranged_attk() in mdlib.c
nhmall [Sat, 5 Nov 2022 16:38:02 +0000 (12:38 -0400)]
prefix static version of ranged_attk() in mdlib.c

2 years agoSet registry ISO10646 at run time
Ray Chason [Sat, 5 Nov 2022 15:56:21 +0000 (11:56 -0400)]
Set registry ISO10646 at run time

We don't know at compile time whether the X server even supports
Unicode. So take the configured map font, change the registry to
ISO10646 and try the resulting font string. Keep the configured
font if that doesn't work.

2 years agoAdd Unicode, IBMgraphics and DECgraphics to X11
Ray Chason [Sat, 5 Nov 2022 04:40:04 +0000 (00:40 -0400)]
Add Unicode, IBMgraphics and DECgraphics to X11

2 years agoAdd Xlib.h
Ray Chason [Fri, 4 Nov 2022 02:13:52 +0000 (22:13 -0400)]
Add Xlib.h

Gets us running on XFree86 3.3.5

2 years agoFix inadvertent change of strchr to index
Ray Chason [Thu, 3 Nov 2022 23:58:56 +0000 (19:58 -0400)]
Fix inadvertent change of strchr to index

Thanks to entrez for pointing this out.

2 years agoUse "magenta" for bright magenta
Ray Chason [Thu, 3 Nov 2022 23:35:41 +0000 (19:35 -0400)]
Use "magenta" for bright magenta

Older X servers don't understand "Fuchsia," and NetHack throws
impossibles as a result. The current Xorg defines "magenta" as the
same color as "Fuchsia," namely #FF00FF, and older X servers
understand "magenta."

The resulting X11 NetHack is known to work with XFree86 4.2.0.
The minimum version remains undetermined.

2 years agoDefine and use PRINTF_F_PTR
Ray Chason [Thu, 3 Nov 2022 23:33:30 +0000 (19:33 -0400)]
Define and use PRINTF_F_PTR

GCCs older than 3.1 understand __attribute__(printf(...)), but only
with functions; it doesn't work with function pointers. This change
uses PRINTF_F_PTR to remove the attribute from two function pointers.

This change establishes GCC 3.0 as the minimum version to build
NetHack. Older versions have trouble with the variadic macros and
variable declarations in mid-block.

2 years agoprefix some macro names
nhmall [Thu, 3 Nov 2022 20:50:25 +0000 (16:50 -0400)]
prefix some macro names

2 years agoadjust 4 line lengths from previous commit
nhmall [Thu, 3 Nov 2022 19:50:32 +0000 (15:50 -0400)]
adjust 4 line lengths from previous commit

2 years agopurge more E for extern
nhmall [Thu, 3 Nov 2022 19:42:24 +0000 (15:42 -0400)]
purge more E for extern

2 years agochange #vanquished from wizard mode to normal play
PatR [Thu, 3 Nov 2022 07:00:34 +0000 (00:00 -0700)]
change #vanquished from wizard mode to normal play

Make the existing '#vanquished' command be available during regular
play, with M-V bound to it.  'm #vanquished' or 'm M-V' brings up
the sorting menu that you get when answering 'a' rather than 'y' at
the end-of-game "disclose vanquished creatures?" prompt.

The original #vanquished came from slash'em, where it was available
in normal play.  When added to nethack, it was put in as wizard-mode-
only. I added the sorting capability several years ago.

The chosen sort is remembered and re-used if not reset but only for
the remainder of the current session.  It probably ought of become
a run-time option so be settable in advance and across sessions but
I haven't done that.

2 years ago'bad negation' during config file processing
PatR [Wed, 2 Nov 2022 22:56:10 +0000 (15:56 -0700)]
'bad negation' during config file processing

This fixes the problem with reporting "the <foo> option may not
both have a value and be negated" to stdout if delivered before the
interface has been set up, so possibly not be seen.  It has been
using pline_The() but that uses rawprint() during startup.

Unfortunately testing it has uncovered another config file error
reporting issue and this one won't be so easy to fix.  For a logical
line that uses backslash+newline continuations to span multiple
physical lines, when there is a problem it reports the line number
and text of the last segment rather than of the first or of the
specific segment containing the problem.  That isn't necessarily
wrong but is suboptimal.

2 years agorevise Guidebook.mn comment
PatR [Wed, 2 Nov 2022 21:29:35 +0000 (14:29 -0700)]
revise Guidebook.mn comment

2 years agofixes entry for PR #917 - unnaming unique mons
PatR [Tue, 1 Nov 2022 23:26:29 +0000 (16:26 -0700)]
fixes entry for PR #917 - unnaming unique mons

Pull request from entrez:  attempting to unname a unique monster or
shopkeeper by assigning a new name of <space> was rejected as
intended, but the rejection message is phrased strangely when <space>
gets inserted as the name that won't be assigned.

Fixes #917

2 years agoMessage for giving unnameable monster blank name
Michael Meyer [Sat, 29 Oct 2022 03:28:29 +0000 (23:28 -0400)]
Message for giving unnameable monster blank name

The message for trying to (re)name an unnameable monster was weird when
the player entered a blank name (a name consisting of only spaces), in
an attempt to delete the monster's existing name rather than give it a
new one.  Several of the normal messages looked incomplete due to using
the blank string as the "new name" (e.g., "I'm Feyfer, not ."), and the
one which didn't include the name still seemed a little off ("calling
names" is almost the opposite of what the player is doing).  Add a new
message for attempting to erase the name of one of the special
unnameable monsters, e.g. "Juiblex would rather keep his existing name"
or "The Oracle would rather keep her existing title".

I also noticed that the message for trying to give an unrenameable
monster the name it already has (e.g. trying to name Death "Death") was
revealing the genders of the Riders with personal pronouns.  This is
avoided elsewhere (e.g. using "the way" in mdisplacem, "its" baked
into the message in mhitm_ad_deth), so I also added a slightly rephrased
alternate message for Riders which avoids any pronouns.  For the
unnaming message, on the other hand, I just used "its" for the Riders,
since I couldn't think of a way to phrase it that avoided pronouns
entirely.

2 years agotranscription error
nhmall [Tue, 1 Nov 2022 16:58:09 +0000 (12:58 -0400)]
transcription error

2 years agomore unnecessary #undef
nhmall [Tue, 1 Nov 2022 16:52:22 +0000 (12:52 -0400)]
more unnecessary #undef

2 years agoQt: remove obsolete #undef lines
nhmall [Tue, 1 Nov 2022 16:46:10 +0000 (12:46 -0400)]
Qt: remove obsolete #undef lines

2 years agocomment thinko
PatR [Tue, 1 Nov 2022 16:29:19 +0000 (09:29 -0700)]
comment thinko

2 years agoLongbow of Diana
PatR [Tue, 1 Nov 2022 06:13:05 +0000 (23:13 -0700)]
Longbow of Diana

Give an extra +1 to potential multi-shot to rangers wielding the
Longbow of Diana and shooting any type of arrow.  When an elf ranger
has been wielding an elven bow to shoot elvish arrows or an orc
ranger has been wielding an orcish bow to shoot orcish arrows, they
lose their racial bonus but won't lose any multi-shot capability by
switching to their quest artifact.  Human and gnome rangers gain the
+1 bonus.  (I have no idea how a gnome could wield a longbow.  One
would need a step ladder to hold it vertically, and could only draw
the string back a stubby arm's length if they held if horizonally.)

That bonus gets applied before feeding the multi-shot counter to
rnd() so doesn't mean an extra arrow every time.  And you have to
be wielding your own quest artifact--in addition to it being the
appropriate launcher for the ammo you're shooting--so doesn't provide
any multi-shot benefit to other types of characters who wish for it.

2 years agorefine all_options_conds()
PatR [Tue, 1 Nov 2022 00:24:06 +0000 (17:24 -0700)]
refine all_options_conds()

Change the details of all_options_conds() which was added yesterday.
Creates the same output as then for #saveoptions.

2 years agobuild fix for NODUMPENUMS and more issue #916
PatR [Mon, 31 Oct 2022 22:43:14 +0000 (15:43 -0700)]
build fix for NODUMPENUMS and more issue #916

I made more things in dump_enums() static and/or const.  In the
process I discovered both compile problems for NODUMPENUMS and when
fixed, link problems for NODUMPENUMS+ENHANCED_SYMBOLS.

The uft8map.c portion has no changes, just reformatting.

2 years agoMerge branch 'fix-makedefs' of https://github.com/argrath/NetHack into NetHack-3.7
nhmall [Mon, 31 Oct 2022 18:20:10 +0000 (14:20 -0400)]
Merge branch 'fix-makedefs' of https://github.com/argrath/NetHack into NetHack-3.7

2 years agoomdump declaration
nhmall [Mon, 31 Oct 2022 17:29:08 +0000 (13:29 -0400)]
omdump declaration

..\src\allmain.c(1061): warning C4221: nonstandard extension used: 'ed': cannot be initialized using address of automatic variable 'omdump'
..\src\allmain.c(1056): note: see declaration of 'omdump'

Resolves #916

2 years agostatus condition options
PatR [Mon, 31 Oct 2022 07:53:10 +0000 (00:53 -0700)]
status condition options

Option parsing rejected
|OPTIONS=!cond_X
for all valid X.

Using the menu to unselect all condition options treated that as not
having made any choice and didn't make any changes.  That would be
reasonable if nothing was preselected, but things are so unselecting
all of them is a choice.  (A bizarre one, but still should be viable.)

Mostly this deals with including cond_X options when #saveoptions is
used to write a new RC file.  It now produces something like
|OPTIONS=!cond_barehanded,cond_blind,!cond_busy,cond_conf,!cond_deaf,\
|        cond_iron,cond_fly,cond_foodPois,!cond_glowhands,cond_grab,\
|        cond_hallucinat,!cond_held,!cond_ice,cond_lava,cond_levitate,\
|        !cond_paralyzed,cond_ride,!cond_sleep,cond_slime,!cond_slip,\
|        cond_stone,cond_strngl,cond_stun,!cond_submerged,cond_termIll,\
|        !cond_tethered,!cond_trap,!cond_unconscious,!cond_woundedlegs,\
|        !cond_holding
after the last alphabetical option and before the bound keys, menu
colors, and others which aren't simple OPTIONS=X settings.  This only
happens if there is already one or more OPTIONS=cond_X entries in the
old file when it was read or if 'mO' gets used to make any changes.

Not fixed:  after my RC had something similar to the above and before
I changed status conditions to accept negation, I was getting several
"the cond_ option may not both have a value and be negated" messages
written to stdout instead of the config file error handler.  So they
vanished when the screen was initialized without providing a --More--
prompt to acknowledge that they have been seen.

2 years agoremove the code for embedding SCCS ID
SHIRAKATA Kentaro [Mon, 31 Oct 2022 06:57:28 +0000 (15:57 +0900)]
remove the code for embedding SCCS ID

This code is for UNIXy build, but current UNIXy builds define GCC_WARN,
so this is never used.

(After all, embedding SCCS ID itself is out of date.)

2 years agogrammar: "foo based" to "foo-based"
nhmall [Sun, 30 Oct 2022 20:08:14 +0000 (16:08 -0400)]
grammar: "foo based" to "foo-based"

There seems to be a need to locate these in the distribution every decade or so.

2 years agotweak for #914 - attacking nothing
PatR [Sun, 30 Oct 2022 06:48:46 +0000 (23:48 -0700)]
tweak for #914 - attacking nothing

In the code that checks for attacking the edge of the map, the m_at()
that was just introduced isn't at risk of using <0,0> because of the
way 'glyph' is initialized.  But guard against future changes.

And I omitted this when checking the PR #914 commit in:
Closes #914

2 years agopull request #914 - attacks against 'thin air'
PatR [Sat, 29 Oct 2022 22:16:09 +0000 (15:16 -0700)]
pull request #914 - attacks against 'thin air'

Pull request from entrez:  hand-to-hand attack directed at an unseen
displacer beast could give strange feedback if it and hero swapped
places.

2 years agoSome displacer beast swapping tweaks
Michael Meyer [Sat, 29 Oct 2022 01:06:11 +0000 (21:06 -0400)]
Some displacer beast swapping tweaks

When fighting an unseen displacer beast mapped as an 'I' glyph on the
map, its typical ability to swap places with you was disabled and
replaced by it being treated like "thin air".  This was because
execution reaches domove_fight_empty when the target swaps places with
you.  Other than the displacement passive, this function is typically
only reached if there's no monster on the target square, so it prints
the "thin air" message and wastes a turn if you'd "expect" to attack
something (either because the player used an 'F' prefix, or because
there is an 'I' mapped on the destination square being moved into).

Hitting "thin air" seems like OK behavior for force-fighting a displacer
beast, since you are explicitly not trying to move into its spot (though
you could probably make an argument that the displacement should happen
even then, since it's the displacer beast initiating it), but the mon
being mapped as an 'I' doesn't seem like a good reason to disallow the
actual displacement from happening.

Don't treat an 'I' as "thin air" in domove_fight_empty if there's
actually a monster there, since it means there's a displacer beast
trying to swap places with you.

A couple other related changes: put an 'I' down on the map when an
unseen displacer beast swaps places with you, and use 'something' in the
'it swaps places with you' message when you didn't even realize there
was a monster there to begin with, so there's no context for the 'it' (I
used Some_Monnam at first, but the 'something' felt a little weird when
you were intentionally attacking an 'I' or warning glyph; this limits
the usage of 'something' further than Some_Monnam does).

2 years agosome C99 changes
nhmall [Sat, 29 Oct 2022 14:54:25 +0000 (10:54 -0400)]
some C99 changes

Instead of using index() macro defined to strchr, use C99 strchr.
Instead of using rindex() macro defined to strrchr, use C99 strrchr.

If you want to try building on a platform that doesn't offer those
two functions, these are available:
    define NOT_C99       /* to make some non-C99 code available */
    define NEED_INDEX    /* to define a macro for index()  */
    define NEED_RINDX    /* to define a macro for rindex() */

2 years agomore OSX -> macOS
nhmall [Sat, 29 Oct 2022 14:46:14 +0000 (10:46 -0400)]
more OSX -> macOS

2 years agofixes update for pr913 part 2
nhmall [Sat, 29 Oct 2022 14:43:58 +0000 (10:43 -0400)]
fixes update for pr913 part 2

2 years agofixes entry for pr913
nhmall [Sat, 29 Oct 2022 14:38:29 +0000 (10:38 -0400)]
fixes entry for pr913

2 years agoMerge branch 'qt6-buttons' of https://github.com/chasonr/NetHack into NetHack-3.7
nhmall [Sat, 29 Oct 2022 14:33:37 +0000 (10:33 -0400)]
Merge branch 'qt6-buttons' of https://github.com/chasonr/NetHack into NetHack-3.7

2 years agoRevert "PR913 - Another Qt 6 signal: mapped -> mappedString"
nhmall [Sat, 29 Oct 2022 14:33:17 +0000 (10:33 -0400)]
Revert "PR913 - Another Qt 6 signal: mapped -> mappedString"

This reverts commit 57617da39b36466dc7d98026394f7a526997f254.

2 years agofix RC file CHOOSE '[section] #comment'
PatR [Sat, 29 Oct 2022 06:26:39 +0000 (23:26 -0700)]
fix RC file CHOOSE '[section] #comment'

Two years ago I modified the parsing for [section] labels for the
config file's CHOOSE directive to allow end-of-line comments, but
the code used had a logic error (don't think I can blame it on
copy+paste).  It looked for '#' after ']' but allowed anything--
rather than just spaces--in between.

"[section-name]abc#comment" would become "section-name" as if the
trailing junk hadn't been present.  Parsing that should produce
"section-name]abc" and get rejected as invalid.

2 years agow_blocks()
PatR [Fri, 28 Oct 2022 23:27:41 +0000 (16:27 -0700)]
w_blocks()

Add the fix that silences whatever extra warning was enabled for the
onefile testing.  The original already worked as intended.

2 years agoanother comment typo fix
PatR [Fri, 28 Oct 2022 07:30:38 +0000 (00:30 -0700)]
another comment typo fix

2 years agoyet more knockback induced dismount
PatR [Fri, 28 Oct 2022 07:27:32 +0000 (00:27 -0700)]
yet more knockback induced dismount

The revision to directed dismount during knockback introduced a bug.
Need parentheses to prevent || that follows ?: from binding with :.

2 years agoPR913 - Another Qt 6 signal: mapped -> mappedString
Ray Chason [Fri, 28 Oct 2022 02:59:30 +0000 (22:59 -0400)]
PR913 - Another Qt 6 signal: mapped -> mappedString

2 years agoAnother Qt 6 signal: mapped -> mappedString
Ray Chason [Fri, 28 Oct 2022 02:50:17 +0000 (22:50 -0400)]
Another Qt 6 signal: mapped -> mappedString

2 years agomore Guidebook updates
nhmall [Fri, 28 Oct 2022 02:27:00 +0000 (22:27 -0400)]
more Guidebook updates

2 years agoMerge branch 'showgold-guidebook-update' of https://github.com/entrez/NetHack into...
nhmall [Fri, 28 Oct 2022 02:23:34 +0000 (22:23 -0400)]
Merge branch 'showgold-guidebook-update' of https://github.com/entrez/NetHack into NetHack-3.7

2 years agoMerge branch 'pr913' into NetHack-3.7
nhmall [Fri, 28 Oct 2022 02:15:00 +0000 (22:15 -0400)]
Merge branch 'pr913' into NetHack-3.7

2 years agoMerge branch 'qt6-buttons' of https://github.com/chasonr/NetHack into pr913
nhmall [Fri, 28 Oct 2022 02:14:13 +0000 (22:14 -0400)]
Merge branch 'qt6-buttons' of https://github.com/chasonr/NetHack into pr913