]> granicus.if.org Git - nethack/log
nethack
3 years agoparsebindings() vs commas
PatR [Sat, 8 Jan 2022 20:32:49 +0000 (12:32 -0800)]
parsebindings() vs commas

The set-but-not-used warning for 'ret' revealed an actual bug this
time.  Parsing sysconf cares whether any errors were encountered
when parsing its contents, but BINDINGS=key1:cmd1,key2:cmd2 only
returned the result of the first key in the comma-separated list
because the result from recursive calls was lost to the set-but-
not-used variable.  Just adding use of that variable would have
ended up reporting success if any key bound succesfully rather than
requiring that they all do as sysconf parse handling intends.

Also, binding comma to a command required that it be specified by
its numeric value because parsing via recursion ate up the actual
commas.  Now allow "BINDINGS=,:cmd" or "keyM:cmdM,,:cmdN" or
"BINDINGS=\,:cmd" or "keyM:cmdM,\,:cmdN".

It also recognizes "BINDINGS=',':cmd" and "keyM:cmdM,',':cmdN" but
that yields an invalid key error for "','".  I thought txt2key()
supported that but it doesn't.  I've left this in because the error
about ',' not being recognized as a key seems better than one about
"'" not being a valid key bind and then accidentally binding single
quote via post-comma "':command".

3 years agohmonas() unused 'nsum'
PatR [Sat, 8 Jan 2022 18:57:16 +0000 (10:57 -0800)]
hmonas() unused 'nsum'

Get rid of set-but-not-otherwise-used variable 'nsum'.  At one time
it was used to figure out hmonas()'s return value, but that changed
three years ago.  And hmonas()'s only caller discards that return
value anyway.

3 years agotone down a comment
nhmall [Sat, 8 Jan 2022 18:41:47 +0000 (13:41 -0500)]
tone down a comment

3 years agoAdd "user canceled" as extended command return value
Pasi Kallinen [Sat, 8 Jan 2022 18:04:54 +0000 (20:04 +0200)]
Add "user canceled" as extended command return value

Instead of returning ECMD_OK, the commands now return ECMD_CANCEL
when user declined to pick a direction or an object to act on.

Note that this can be ORed with ECMD_TIME, if the command still
took a turn.

For now this has no gameplay meaning.

3 years agoRemove useless variable
Pasi Kallinen [Sat, 8 Jan 2022 17:15:02 +0000 (19:15 +0200)]
Remove useless variable

3 years agofix some libnh wasm build issues
nhmall [Sat, 8 Jan 2022 16:16:57 +0000 (11:16 -0500)]
fix some libnh wasm build issues

emcc: error: linker setting ignored during compilation: 'ASSERTIONS' [-Wunused-command-line-argument] [-Werror]
make[1]: *** [Makefile:1306: ../targets/wasm/allmain.o] Error 1

wasm-ld: error: ../targets/wasm/version.o: undefined symbol: nomakedefs

These ones look like actual NetHack issues that this particular compile is catching due to
default -Wunused-but-set-variable.

In the interest of time today, I mostly resorted to using nhUse() on them for now, but a
follow-up by someone might be useful.

options.c:6069:13: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
    boolean ret = FALSE;
            ^

restore.c:903:9: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
    int len = 0;
        ^

uhitm.c:4539:43: error: variable 'nsum' set but not used [-Werror,-Wunused-but-set-variable]
    int i, tmp, armorpenalty, sum[NATTK], nsum = MM_MISS,
                                          ^

3 years agoupdate_inventory arg change
nhmall [Sat, 8 Jan 2022 15:04:40 +0000 (10:04 -0500)]
update_inventory arg change

Commit dd4943129601a2482531c782852f9a744c7362e6 changed the window port
interface to add an argument to update_inventory, but neglected to fix
the win/shim files.

3 years agolibnh missing prototypes
nhmall [Sat, 8 Jan 2022 15:00:35 +0000 (10:00 -0500)]
libnh missing prototypes

3 years agotty: document the termcap codes
Pasi Kallinen [Fri, 7 Jan 2022 15:41:35 +0000 (17:41 +0200)]
tty: document the termcap codes

some of the termcap codes were missing document comments.

3 years agoFix a brain fart when ORing MM_NOMSG
Pasi Kallinen [Fri, 7 Jan 2022 05:24:21 +0000 (07:24 +0200)]
Fix a brain fart when ORing MM_NOMSG

3 years agoQt: force 'toptenwin' option On
PatR [Thu, 6 Jan 2022 20:25:17 +0000 (12:25 -0800)]
Qt: force 'toptenwin' option On

'toptenwin' defaults to false, so the high scores list at end of game
gets written to stdout by default.  stdout might be a bit bucket if
the game is started from a menu somewhere or from Explorer or Finder
or something comparable.  Even when started from a terminal, writing
to stdout is bad if running asynchronously ('nethack &').

Have Qt init force the 'toptenwin' option to true to show the high
scores in a pop-up text window.  The "since you were in wizard mode
your score is ignored" line also goes to a pop-up text window now too.
An extra <return> is needed to dismiss that when quitting if you go
through the full disclosure sequence.

'nethack -s' writes scores to stdout before interface initialization
takes place, so isn't affected by this change.  That's intentional so
that 'nethack -s > ~/myscores' can be used to capture the output.

3 years agoApply a wielded bullwhip with fire-command
Pasi Kallinen [Thu, 6 Jan 2022 15:12:30 +0000 (17:12 +0200)]
Apply a wielded bullwhip with fire-command

3 years agoDon't autoquiver aklys
Pasi Kallinen [Thu, 6 Jan 2022 12:39:27 +0000 (14:39 +0200)]
Don't autoquiver aklys

... even though it is a throwing weapon, it's meant to be wielded
and fired instead of fired from quiver.

3 years agoFixes entry
Pasi Kallinen [Thu, 6 Jan 2022 12:34:33 +0000 (14:34 +0200)]
Fixes entry

3 years agoAccessibility: give message for created monsters
Pasi Kallinen [Thu, 6 Jan 2022 12:00:52 +0000 (14:00 +0200)]
Accessibility: give message for created monsters

Always give a message when creating a detected monster
during gameplay (as opposed to during level creation).
To prevent the message, use the MM_NOMSG flag for makemon.

Most places already handled their own messaging, but there
were some, such as bag of tricks, create monster magic
and random monsters created during gameplay that didn't.

3 years agofixes entry for PR #651 - single-char engraving
PatR [Thu, 6 Jan 2022 09:44:45 +0000 (01:44 -0800)]
fixes entry for PR #651 - single-char engraving

Pull request from vultur-cadens:  when engraving with a weapon, the
occupation routine doesn't dull it on the last character, so engraving
a single character never dulled the weapon.  Didn't apply to engraving
with other types of items.

Closes #651

3 years agoFix single-character engraving not dulling the weapon.
vultur-cadens [Wed, 5 Jan 2022 02:31:53 +0000 (18:31 -0800)]
Fix single-character engraving not dulling the weapon.

3 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
Alex Smith [Wed, 5 Jan 2022 23:22:54 +0000 (23:22 +0000)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

3 years agoMessage fix for burden changes during end-of-turn updates
Alex Smith [Wed, 5 Jan 2022 23:17:27 +0000 (23:17 +0000)]
Message fix for burden changes during end-of-turn updates

This fixes the messages displayed when, e.g., the hero becomes
unburdened as a consequence of a corpse rotting away. (There are no
gameplay changes; the effective burden level is fixed between turns
under both the old and new mechanisms, and any other use of it will
recalculate it prior to using it.)

Not changed: the interaction of overexert_hp with burden changes due
to timeout. You were holding the corpse during your turn, so even if
it rots away at the end of the turn, you can still pass out from the
exertion you applied during that turn.

3 years agomakedefs revision
PatR [Wed, 5 Jan 2022 20:50:21 +0000 (12:50 -0800)]
makedefs revision

This started out as fix for a comment but ended up redoing 'limit()'
and its 'temp[]' because they seemed likely to someday interfere with
other uses of such generic names.

No change to observable behavior.

3 years agoAdd missing article
Pasi Kallinen [Wed, 5 Jan 2022 16:00:28 +0000 (18:00 +0200)]
Add missing article

3 years agoAllocate rects dynamically
Pasi Kallinen [Wed, 5 Jan 2022 15:35:30 +0000 (17:35 +0200)]
Allocate rects dynamically

... instead of hard-coding them to 50. New allocated value is
(COLNO*ROWNO)/30, which is slightly higher (56), and that formula
seems to work for hypothetical larger maps too.

3 years agoFix segfault in hypothetical case of huge COLNO
Pasi Kallinen [Wed, 5 Jan 2022 11:51:44 +0000 (13:51 +0200)]
Fix segfault in hypothetical case of huge COLNO

3 years agoFix X11 tombstone string overflow
Pasi Kallinen [Tue, 4 Jan 2022 20:28:00 +0000 (22:28 +0200)]
Fix X11 tombstone string overflow

3 years agoQt tile rendering
PatR [Tue, 4 Jan 2022 20:23:06 +0000 (12:23 -0800)]
Qt tile rendering

Get rid of the no longer used 'fem' argument for Qt's tile drawing
routines.  It's incorporated in the tile index these days.

3 years agoQt: more ant extermination
PatR [Tue, 4 Jan 2022 19:54:05 +0000 (11:54 -0800)]
Qt: more ant extermination

After the fairly recent glyph changes, the icons shown for roles and
races during the character selection dialog all were all depicted by
the giant ant tile.  I might have noticed this sooner but usually
have '-@' on the command line to bypass selection.

3 years agoUpdate lua api docs
Pasi Kallinen [Tue, 4 Jan 2022 19:29:06 +0000 (21:29 +0200)]
Update lua api docs

3 years agoMark extended commands accepting m-prefix in the command flags
Pasi Kallinen [Tue, 4 Jan 2022 17:29:15 +0000 (19:29 +0200)]
Mark extended commands accepting m-prefix in the command flags

3 years agofixes entry for ubuntu 21.10 change
nhmall [Tue, 4 Jan 2022 13:48:21 +0000 (08:48 -0500)]
fixes entry for ubuntu 21.10 change

Note: Previous commit incorrectly stated 20.10 when it should have
stated 21.10 for impish.

3 years agowork around ubuntu 20.10 build issue
nhmall [Tue, 4 Jan 2022 13:24:08 +0000 (08:24 -0500)]
work around ubuntu 20.10 build issue

NetHack was trying to suppress warn_unused_result
in include/tradstdc.h, by defining warn_unused_result
to an empty string. That began causing a build error
in a system-supplied header file cdefs.h
when using 20.10 ubuntu impish.

Try skipping that in tradstdc.h for any linux, unless
the NetHack build defines GCC_URWARN to force it into
play.

3 years agoReuse code to limit look region
Pasi Kallinen [Tue, 4 Jan 2022 11:10:33 +0000 (13:10 +0200)]
Reuse code to limit look region

3 years agoAdd a false rumor
Pasi Kallinen [Tue, 4 Jan 2022 09:14:12 +0000 (11:14 +0200)]
Add a false rumor

3 years agoMake the adventurer ghost asleep
Pasi Kallinen [Tue, 4 Jan 2022 08:55:09 +0000 (10:55 +0200)]
Make the adventurer ghost asleep

3 years agoupdate patchlevel.h copyright
nhmall [Tue, 4 Jan 2022 05:08:12 +0000 (00:08 -0500)]
update patchlevel.h copyright

3 years agotabs to spaces in tilemap.c
nhmall [Tue, 4 Jan 2022 01:52:57 +0000 (20:52 -0500)]
tabs to spaces in tilemap.c

3 years agogcc-11 warnings in tilemap.c
nhmall [Tue, 4 Jan 2022 01:44:45 +0000 (20:44 -0500)]
gcc-11 warnings in tilemap.c

../win/share/tilemap.c: In function ‘init_tilemap’:
../win/share/tilemap.c:705:61: warning: ‘%s’ directive writing up to 255 bytes into a region of size 122 [-Wformat-overflow=]
  705 |         Sprintf(tilemap[GLYPH_MON_MALE_OFF + i].name, "male %s", buf);
      |                                                             ^~   ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 6 and 261 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:705:9: note: in expansion of macro ‘Sprintf’
  705 |         Sprintf(tilemap[GLYPH_MON_MALE_OFF + i].name, "male %s", buf);
      |         ^~~~~~~
../win/share/tilemap.c:706:64: warning: ‘%s’ directive writing up to 255 bytes into a region of size 118 [-Wformat-overflow=]
  706 |         Sprintf(tilemap[GLYPH_PET_MALE_OFF + i].name, "%s male %s", "pet", buf);
      |                                                                ^~          ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 10 and 265 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:706:9: note: in expansion of macro ‘Sprintf’
  706 |         Sprintf(tilemap[GLYPH_PET_MALE_OFF + i].name, "%s male %s", "pet", buf);
      |         ^~~~~~~
../win/share/tilemap.c:707:67: warning: ‘%s’ directive writing up to 255 bytes into a region of size 113 [-Wformat-overflow=]
  707 |         Sprintf(tilemap[GLYPH_DETECT_MALE_OFF + i].name, "%s male %s", "detected", buf);
      |                                                                   ^~               ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 15 and 270 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:707:9: note: in expansion of macro ‘Sprintf’
  707 |         Sprintf(tilemap[GLYPH_DETECT_MALE_OFF + i].name, "%s male %s", "detected", buf);
      |         ^~~~~~~
../win/share/tilemap.c:708:67: warning: ‘%s’ directive writing up to 255 bytes into a region of size 115 [-Wformat-overflow=]
  708 |         Sprintf(tilemap[GLYPH_RIDDEN_MALE_OFF + i].name, "%s male %s", "ridden", buf);
      |                                                                   ^~             ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 13 and 268 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:708:9: note: in expansion of macro ‘Sprintf’
  708 |         Sprintf(tilemap[GLYPH_RIDDEN_MALE_OFF + i].name, "%s male %s", "ridden", buf);
      |         ^~~~~~~
../win/share/tilemap.c:709:55: warning: ‘%s’ directive writing up to 255 bytes into a region of size 119 [-Wformat-overflow=]
  709 |         Sprintf(tilemap[GLYPH_BODY_OFF + i].name, "%s %s", "body of", buf);
      |                                                       ^~              ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 9 and 264 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:709:9: note: in expansion of macro ‘Sprintf’
  709 |         Sprintf(tilemap[GLYPH_BODY_OFF + i].name, "%s %s", "body of", buf);
      |         ^~~~~~~
../win/share/tilemap.c:710:63: warning: ‘%s’ directive writing up to 255 bytes into a region of size 111 [-Wformat-overflow=]
  710 |         Sprintf(tilemap[GLYPH_BODY_PILETOP_OFF + i].name, "%s %s", "piletop body of", buf);
      |                                                               ^~                      ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 17 and 272 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:710:9: note: in expansion of macro ‘Sprintf’
  710 |         Sprintf(tilemap[GLYPH_BODY_PILETOP_OFF + i].name, "%s %s", "piletop body of", buf);
      |         ^~~~~~~
../win/share/tilemap.c:732:62: warning: ‘%s’ directive writing up to 255 bytes into a region of size 120 [-Wformat-overflow=]
  732 |         Sprintf(tilemap[GLYPH_MON_FEM_OFF + i].name, "female %s", buf);
      |                                                              ^~   ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 8 and 263 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:732:9: note: in expansion of macro ‘Sprintf’
  732 |         Sprintf(tilemap[GLYPH_MON_FEM_OFF + i].name, "female %s", buf);
      |         ^~~~~~~
../win/share/tilemap.c:733:65: warning: ‘%s’ directive writing up to 255 bytes into a region of size 116 [-Wformat-overflow=]
  733 |         Sprintf(tilemap[GLYPH_PET_FEM_OFF + i].name, "%s female %s", "pet",
      |                                                                 ^~
  734 |                 buf);
      |                 ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 12 and 267 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:733:9: note: in expansion of macro ‘Sprintf’
  733 |         Sprintf(tilemap[GLYPH_PET_FEM_OFF + i].name, "%s female %s", "pet",
      |         ^~~~~~~
../win/share/tilemap.c:735:68: warning: ‘%s’ directive writing up to 255 bytes into a region of size 111 [-Wformat-overflow=]
  735 |         Sprintf(tilemap[GLYPH_DETECT_FEM_OFF + i].name, "%s female %s",
      |                                                                    ^~
  736 |                 "detected", buf);
      |                             ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 17 and 272 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:735:9: note: in expansion of macro ‘Sprintf’
  735 |         Sprintf(tilemap[GLYPH_DETECT_FEM_OFF + i].name, "%s female %s",
      |         ^~~~~~~
../win/share/tilemap.c:737:68: warning: ‘%s’ directive writing up to 255 bytes into a region of size 113 [-Wformat-overflow=]
  737 |         Sprintf(tilemap[GLYPH_RIDDEN_FEM_OFF + i].name, "%s female %s",
      |                                                                    ^~
  738 |                 "ridden", buf);
      |                           ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 15 and 270 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:737:9: note: in expansion of macro ‘Sprintf’
  737 |         Sprintf(tilemap[GLYPH_RIDDEN_FEM_OFF + i].name, "%s female %s",
      |         ^~~~~~~
../win/share/tilemap.c:739:55: warning: ‘%s’ directive writing up to 255 bytes into a region of size 119 [-Wformat-overflow=]
  739 |         Sprintf(tilemap[GLYPH_BODY_OFF + i].name, "%s %s", "body of", buf);
      |                                                       ^~              ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 9 and 264 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:739:9: note: in expansion of macro ‘Sprintf’
  739 |         Sprintf(tilemap[GLYPH_BODY_OFF + i].name, "%s %s", "body of", buf);
      |         ^~~~~~~
../win/share/tilemap.c:740:63: warning: ‘%s’ directive writing up to 255 bytes into a region of size 111 [-Wformat-overflow=]
  740 |         Sprintf(tilemap[GLYPH_BODY_PILETOP_OFF + i].name, "%s %s",
      |                                                               ^~
  741 |                 "piletop body of", buf);
      |                                    ~~~
In file included from ../include/config.h:643,
                 from ../include/hack.h:10,
                 from ../win/share/tilemap.c:20:
../include/global.h:254:24: note: ‘sprintf’ output between 17 and 272 bytes into a destination of size 127
  254 | #define Sprintf (void) sprintf
../win/share/tilemap.c:740:9: note: in expansion of macro ‘Sprintf’
  740 |         Sprintf(tilemap[GLYPH_BODY_PILETOP_OFF + i].name, "%s %s",
      |         ^~~~~~~
cc -rdynamic -lm -o tilemap tilemap.o ../src/objects.o  \
        ../src/monst.o  ../src/drawing.o

3 years agowounded legs fixes
PatR [Mon, 3 Jan 2022 21:44:05 +0000 (13:44 -0800)]
wounded legs fixes

Document 'HWounded_legs' vs 'EWounded_legs'; they aren't used the way
other properties use their intrinsic and extrinsic values.  And they
switch from hero to steed when riding.  (Can't start riding when
hero's legs are wounded and the steed's legs magically heal when hero
dismounts, so existing wounds never transfer from one to the other.)

Having one leg become injured when the other already was would cure
the other leg but keep the longer of their two timeouts for the new
injury.  Eliminate that mystery cure.  Since their timeouts aren't
tracked separately, the best that can be done is to make both legs
eventually recover at the same time.

Make ^X report which leg is the wounded one when only one of them is.
(It already implicitly reports the both-legs case by using plural.)

When zapping a wand of probing downward while riding, include wounded
leg feedback for the steed.

Simplify wounded leg feedback when probing self a little bit.

Make drinking blessed potions of full healing cure wounded legs for
hero when not mounted or for steed when mounted.  (The latter is a
bit strange--hero drinks potion, steed gets affected--but it's magic.)

Make drinking uncursed potions of full healing or blessed potions of
extra healing cure wounded legs for hero (but not steed; the magic
either isn't that strong or maybe not that reliable...).

3 years agoImprove wizmode-only command unavailability reporting
Pasi Kallinen [Mon, 3 Jan 2022 16:06:11 +0000 (18:06 +0200)]
Improve wizmode-only command unavailability reporting

3 years agoQt map
PatR [Sun, 2 Jan 2022 21:56:53 +0000 (13:56 -0800)]
Qt map

The second half of qt_map.cpp is suppressed by '#if 0'.  Make the
same change to prevent a column of giant ants shown for map column 0
in that unused code as was made for the active code.

3 years agoAdd theme room: Ghost of an Adventurer
Pasi Kallinen [Sun, 2 Jan 2022 17:51:32 +0000 (19:51 +0200)]
Add theme room: Ghost of an Adventurer

3 years agoAdd few hallu colors
Pasi Kallinen [Sun, 2 Jan 2022 13:10:32 +0000 (15:10 +0200)]
Add few hallu colors

3 years agoremove duplicate code in set_option_mod_status()
PatR [Sun, 2 Jan 2022 10:03:49 +0000 (02:03 -0800)]
remove duplicate code in set_option_mod_status()

Remove a duplicate option name lookup loop.  At one time the first
loop checked boolean options and second checked compound options,
but that changed a couple of years ago so that both loops check all
options and the second one became redundant.

3 years agoQt without tiles
PatR [Sun, 2 Jan 2022 09:48:07 +0000 (01:48 -0800)]
Qt without tiles

When tiles fail to load, the Qt interface switches to the text map.
But it wasn't inhibiting the player from trying to switch to tiles
map.  Also, when the text map was in use it was forcing the paper
doll inventory subset to be disabled regardless of whether the map
was by choice or because tiles wouldn't load.  Allow the paper doll
in combination with the text map if tiles got loaded successfully.

3 years agotiled_map option
PatR [Sun, 2 Jan 2022 08:35:52 +0000 (00:35 -0800)]
tiled_map option

It was possible to toggle ascii_map On (which toggles tiled_map Off)
and Off (so tiled_map On) during play, but tiled_map was marked as
config-file only so the converse pair of operations weren't allowed.
Allow tiled_map to be toggled On or Off during play.

3 years agoDefine extra sanity checks if not a release
Pasi Kallinen [Sat, 1 Jan 2022 23:14:16 +0000 (01:14 +0200)]
Define extra sanity checks if not a release

3 years agoensure a sane startup color for windows console
nhmall [Sat, 1 Jan 2022 22:44:14 +0000 (17:44 -0500)]
ensure a sane startup color for windows console

3 years agoInit variable just in case
Pasi Kallinen [Sat, 1 Jan 2022 14:58:34 +0000 (16:58 +0200)]
Init variable just in case

3 years agoAllow tipping container directly into another
Pasi Kallinen [Sat, 1 Jan 2022 14:15:29 +0000 (16:15 +0200)]
Allow tipping container directly into another

3 years agoadd Lua to Qt's "About nethack"
PatR [Sat, 1 Jan 2022 02:15:34 +0000 (18:15 -0800)]
add Lua to Qt's "About nethack"

Add "Lua" and its version number of the 'About' popup.  No copyright
information is included since neither nethack's nor Qt's is shown.

Lua copyright text is included in the output of '#version'.

3 years agoQt tiles file loading
PatR [Fri, 31 Dec 2021 23:29:10 +0000 (15:29 -0800)]
Qt tiles file loading

Redo how Qt retries if it can't load the primary tiles file.

3 years agomore NO_TILE_C
PatR [Fri, 31 Dec 2021 23:02:35 +0000 (15:02 -0800)]
more NO_TILE_C

When USE_TILES is disabled, don't let wc_tiled_map be the default.

Qt is capable of showing an (ugly) ascii map, and will do so if built
with NO_TILE_C after this fix (it defaults to tiles without this),
but it requires that a tiles file be loaded because it displays tiles
in other places besides the map, like role selection.  So it can't
skip them when wc_ascii_map is set.

3 years agoNO_TILE_C => no USE_TILES in tile.c
PatR [Fri, 31 Dec 2021 21:49:43 +0000 (13:49 -0800)]
NO_TILE_C => no USE_TILES in tile.c

Compiling with NO_TILE_C defined results in preventing USE_TILES
from being defined and that causes display.c to use alternate code.
Construct src/tile.c such that nethack links successfully if the
configuration specifies NO_TILE_C but the Makefile goes ahead and
builds tile.c, compiles it, and links with it, otherwise it conflicts
with that alternate code.  Prior to this, linking gave two complaints
about duplicate symbols and failed.

3 years agochange MacOSX to MacOS in version display
nhmall [Fri, 31 Dec 2021 21:44:15 +0000 (16:44 -0500)]
change MacOSX to MacOS in version display

3 years agomacOS homebrew qt@5
nhmall [Fri, 31 Dec 2021 21:06:30 +0000 (16:06 -0500)]
macOS homebrew qt@5

Once 'brew update' and 'brew upgrade' had been done, the qt@5
package did become available for installation and the original
line in the hints file worked, so put it back as it was.

3 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Fri, 31 Dec 2021 19:24:08 +0000 (14:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

3 years agoDefine engulfing_u, making clearer code
Pasi Kallinen [Fri, 31 Dec 2021 19:12:12 +0000 (21:12 +0200)]
Define engulfing_u, making clearer code

3 years agolinux-minimal hints was used with the CI
nhmall [Fri, 31 Dec 2021 19:02:35 +0000 (14:02 -0500)]
linux-minimal hints was used with the CI

3 years agoLeprechauns bury their gold after teleporting
Pasi Kallinen [Fri, 31 Dec 2021 16:48:44 +0000 (18:48 +0200)]
Leprechauns bury their gold after teleporting

3 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Fri, 31 Dec 2021 14:24:08 +0000 (09:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

3 years agohints updates
nhmall [Thu, 30 Dec 2021 21:46:07 +0000 (16:46 -0500)]
hints updates

move out-of-date hints files to the outdated folder.

rename the hints files, and hints/include files that are currently
named *.2020 to *.370 (next release number).

3 years agoQt splash code
PatR [Fri, 31 Dec 2021 09:53:46 +0000 (01:53 -0800)]
Qt splash code

Move the handling for the Qt interface's splash window into its own
routine to unclutter the constructor for QtBind.  Also, don't load
nhsplash.xpm if OPTIONS=!splash has been specified.

3 years agosync linux.2020 topology with macOS.2020
nhmall [Thu, 30 Dec 2021 23:05:45 +0000 (18:05 -0500)]
sync linux.2020 topology with macOS.2020

3 years agoQt map column 0
PatR [Thu, 30 Dec 2021 22:07:59 +0000 (14:07 -0800)]
Qt map column 0

Column 0 ought to be suppressed like it is for tty and curses (not
sure about X11 or Windows GUI), but until that happens, display it as
'nothing'.  The glyph overhaul not too long ago resulted in it being
shown as a column of giant ants.

We ought to have some special 'none of the above' tile #0 that will
stand out enough to be reported and fixed.  Glyph #0 too.

3 years agoremove qt-specifc hints file
nhmall [Thu, 30 Dec 2021 21:27:02 +0000 (16:27 -0500)]
remove qt-specifc hints file

3 years agomacOS homebrew Qt5 build fix
nhmall [Thu, 30 Dec 2021 20:36:59 +0000 (15:36 -0500)]
macOS homebrew Qt5 build fix

I had to revert this line in order to build on macOS Monterey.

3 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Thu, 30 Dec 2021 20:15:39 +0000 (15:15 -0500)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

3 years agoqt6 support follow-up
nhmall [Thu, 30 Dec 2021 20:11:49 +0000 (15:11 -0500)]
qt6 support follow-up

encompass Qt6 support in the common hints file macOS.2020 instead
of a separate macOS.2020-qt6, which had already diverged and would
likely be a maintenance headache.

From the Makefile perspective:
WANT_WIN_QT=1 will default to Qt5
WANT_WIN_QT5=1 will assume Qt5
WANT_WIN_QT6=1 will assume Qt6

You must have the appropriate Qt installed, of course.
I expect some additional fine-tuning will be needed as this gets
tried out.

3 years agoQt vs C() macro
PatR [Thu, 30 Dec 2021 19:29:03 +0000 (11:29 -0800)]
Qt vs C() macro

Our C() macro conflicts with Qt6 usage, so #undef C has added.  Move
that from nearly every qt_*.cpp into qt_pre.h where other similar
fixups are handled.

3 years agoFix: chameleon quickmimic not reset after eating
Michael Meyer [Thu, 30 Sep 2021 04:26:01 +0000 (00:26 -0400)]
Fix: chameleon quickmimic not reset after eating

finish_meating was checking whether the monster in question was a
chameleon/shapechanger, rather than whether it was a mimic, in deciding
which monsters should be allowed to maintain their current appearance
once they finish eating.  This meant that true mimics had their
appearance reset, while a chameleon, vampire, etc, who ate a mimic
would maintain their appearance as a tripe ration even after they had
finished eating and resumed their normal behavior.  The result?  An
amazing living tripe ration which followed the hero around throughout
the level.

3 years agoHave the '$' command include gold in your pack
HMM [Mon, 18 Oct 2021 19:04:14 +0000 (15:04 -0400)]
Have the '$' command include gold in your pack

In verbose mode, the gold in your wallet is totaled separately from
that in containers in your pack, and the two are listed separately.
In terse mode, just print the total of both.

Only known gold is mentioned.

3 years agoMerge branch 'Qt6' into NetHack-3.7
PatR [Thu, 30 Dec 2021 19:07:07 +0000 (11:07 -0800)]
Merge branch 'Qt6' into NetHack-3.7

3 years agofixes entry for Qt6 support
PatR [Thu, 30 Dec 2021 19:06:29 +0000 (11:06 -0800)]
fixes entry for Qt6 support

I had a minor merge issue when incorporating Ray's Qt6 port from
github.com/chasonr/NetHack/Qt6 but it got resolved.  This still builds
with Qt5 (and that's the only aspect I've been able to test) but is
supposed to work with Qt6 too.  It adds a new hints file for OSX and
someone might need to create a comparable one for linux.  Or maybe
the differences can be folded into the existing hints as conditional.

Closes #525

3 years agoMake amnesia drain training to appropriate level
George Edward Bulmer [Sat, 23 Oct 2021 13:25:53 +0000 (14:25 +0100)]
Make amnesia drain training to appropriate level

When amnesia drains your skills the skill training would be set
to a random amount rather than a random valid amount for the new
level of skill.

This meant that, for example, you could have Master skill level in
martial arts but with the training amount of Basic.

Attempts to retrain to level martial arts to Grand Master would
then take an extraordinary amount of time compared to usual.

Fix taken from Evilhack

3 years agoMerge branch 'Qt6'
PatR [Thu, 30 Dec 2021 18:56:28 +0000 (10:56 -0800)]
Merge branch 'Qt6'

3 years agoUse QApplication::desktop for screen size on Qt5
Ray Chason [Wed, 29 Dec 2021 06:44:02 +0000 (01:44 -0500)]
Use QApplication::desktop for screen size on Qt5

5.15 has QWidget::screen, but older versions don't.

3 years agoChanges for Qt 6 on MacOS
Ray Chason [Mon, 27 Dec 2021 18:45:54 +0000 (13:45 -0500)]
Changes for Qt 6 on MacOS

3 years agoDon't erase Elbereth when monster steps into a pit or hole dug by you
HMM [Sun, 31 Oct 2021 20:12:25 +0000 (16:12 -0400)]
Don't erase Elbereth when monster steps into a pit or hole dug by you

Elbereth was fading when offscreen monsters stepped into
pits or holes dug elsewhere on the level. This was happening
because monsters falling into traps set by you were calling
setmangry() as if you had just attacked them. The behavior
made it unsafe to use Elbereth if you've dug down anywhere
else on the level, making it a bit harder to get archeologists
off the ground.

3 years agoCorrect the genders of DCSS bogusmons
RojjaCebolla [Sat, 18 Dec 2021 08:07:04 +0000 (03:07 -0500)]
Correct the genders of DCSS bogusmons

Reference: https://github.com/crawl/crawl/blob/master/crawl-ref/source/mon-data.h

3 years agoMake extended commands return defined flags
Pasi Kallinen [Thu, 30 Dec 2021 16:46:30 +0000 (18:46 +0200)]
Make extended commands return defined flags

Instead of returning 0 or 1, we'll now use ECMD_OK or ECMD_TURN.
These have the same meaning as the hardcoded numbers; ECMD_TURN
means the command uses a turn.

In future, could add eg. a flag denoting "user cancelled command"
or "command failed", and should clear eg. the cmdq.

Mostly this was simply replacing return values with the defines
in the extended commands, so hopefully I didn't break anything.

3 years agoadd new TODO item to Qt status: tool tips
PatR [Wed, 29 Dec 2021 19:39:57 +0000 (11:39 -0800)]
add new TODO item to Qt status: tool tips

3 years agoApply a wielded polearm with fire-command
Pasi Kallinen [Wed, 29 Dec 2021 17:40:23 +0000 (19:40 +0200)]
Apply a wielded polearm with fire-command

Wield a polearm and use 'f'ire to automatically hit with it,
if there's a single valid target.
With fireassist-option, will swapweapon to a polearm.
This only applies if quiver is empty and autoquiver is off.

3 years agomakedefs.c comment typo
PatR [Wed, 29 Dec 2021 11:16:31 +0000 (03:16 -0800)]
makedefs.c comment typo

3 years agono USED_SOUNDS option parsing bit
PatR [Wed, 29 Dec 2021 10:21:13 +0000 (02:21 -0800)]
no USED_SOUNDS option parsing bit

If the program is build without USER_SOUNDS and encounters any SOUND
or SOUNDDIR directive when parsing the run-time config file it only
issues an error message about the first one.  When finished parsing,
have it include suppressed ones in the count of errors encountered.

3 years agoQt paper doll fix for two-handed weapons
PatR [Wed, 29 Dec 2021 10:13:34 +0000 (02:13 -0800)]
Qt paper doll fix for two-handed weapons

Allowing optional arguments can be risky.  The recent glyph changes
added a new argument to the routine that constructs a mirror image
of a tile but not to the call to that routine.  Because an existing
argument was optional, the compiler didn't complain about the new
one being missing.

Obsolete optional 'fem' argument ought to removed but this doesn't
tackle that.

3 years agoUse QApplication::desktop for screen size on Qt5
Ray Chason [Wed, 29 Dec 2021 06:44:02 +0000 (01:44 -0500)]
Use QApplication::desktop for screen size on Qt5

5.15 has QWidget::screen, but older versions don't.

3 years agoSplit leprechaun avoidance into separate function
Pasi Kallinen [Tue, 28 Dec 2021 17:11:30 +0000 (19:11 +0200)]
Split leprechaun avoidance into separate function

3 years agoMerge branch 'pr645' into NetHack-3.7
nhmall [Tue, 28 Dec 2021 13:43:07 +0000 (08:43 -0500)]
Merge branch 'pr645' into NetHack-3.7

3 years agoMerge branch 'libnethack-target-fixes' of https://github.com/dextercd/NetHack into...
nhmall [Tue, 28 Dec 2021 13:41:35 +0000 (08:41 -0500)]
Merge branch 'libnethack-target-fixes' of https://github.com/dextercd/NetHack into pr645

3 years agomore possible build fixes
nhmall [Tue, 28 Dec 2021 13:04:59 +0000 (08:04 -0500)]
more possible build fixes

Once again, I need to commit these first and observe the CI results
afterwards to verify the results.

3 years agopossible build fix catch-up for Windows Makefile.gcc
nhmall [Tue, 28 Dec 2021 02:43:46 +0000 (21:43 -0500)]
possible build fix catch-up for Windows Makefile.gcc

Verification once CI attempts a build as no local testing capability

3 years agoXcode build fix
nhmall [Tue, 28 Dec 2021 02:33:01 +0000 (21:33 -0500)]
Xcode build fix

3 years agoQt misuse of Role_if()
PatR [Mon, 27 Dec 2021 22:27:35 +0000 (14:27 -0800)]
Qt misuse of Role_if()

The Qt paper doll highlights known blessed/uncursed/cursed items with
a color border.  It was trying to force obj->bknown for non-blinded
priest[ess] but passed the old role letter argument to Role_if()
instead of the monster number that's used these days.  It was also
potentially modifying an invent item in a way that's observable to
the player but not updating persistent inventory to show that.

Probably didn't matter though; I don't think the situation it checks
for can occur anymore.  On the off chance that it could, move the
check-and-set out of #if ENHANCED_PAPERDOLL so that same inventory
update would occur for ordinary paper doll even though that doesn't
care about displayed items' bless/curse state.

3 years agoChanges for Qt 6 on MacOS
Ray Chason [Mon, 27 Dec 2021 18:45:54 +0000 (13:45 -0500)]
Changes for Qt 6 on MacOS

3 years agored dragon's sight
PatR [Sun, 26 Dec 2021 22:57:29 +0000 (14:57 -0800)]
red dragon's sight

Since wearing red dragon scales/mail confers infravision, give that
ability to red dragons.  Matters when the hero is polymorphed into one.
Also give it to the Chromatic Dragon, where I don't think it matters.

3 years agohero_seq followup
PatR [Sun, 26 Dec 2021 22:40:03 +0000 (14:40 -0800)]
hero_seq followup

Make sure g.hero_seq has a sane value during restore before moveloop()
has a chance to update it.

Have curses use g.hero_seq for messages delivered via putmsghistory().

3 years agofix #K3503 - boulder-carrying monster killed twice
PatR [Sun, 26 Dec 2021 17:44:10 +0000 (09:44 -0800)]
fix #K3503 - boulder-carrying monster killed twice

A giant that is carrying a boulder and standing on ice who drowns when
the ice gets melted could die a second time if the resulting pool gets
plugged by the boulder.  It results in an impossible from dmonsfree()
about bookkeeping inconsistency when dead monsters are removed at the
end of the turn.  The fuzzer escalates that to a panic.

3 years agocurses message management
PatR [Sun, 26 Dec 2021 08:43:24 +0000 (00:43 -0800)]
curses message management

Switch from 'moves' to 'hero_seq' for tracking whether consecutive
messages were issued on the same move and for whether current move
is still same one after played has responded to --More-- with ESC.

3 years agohero_seq
PatR [Sun, 26 Dec 2021 08:16:55 +0000 (00:16 -0800)]
hero_seq

'moves' is actually turns and there hasn't been any straightforward
way to track actual hero moves.  Add hero_seq for that.  It isn't a
counter but is distinct each time the hero makes a move.  I wanted
it for curses ^P support but so far use it for checking stethoscope
usage and for shopkeeper behavior when items in a shop are broken by
the hero.

Increment EDITLEVEL due to change in save file contents.

3 years agodragon armor fix
PatR [Sat, 25 Dec 2021 22:31:33 +0000 (14:31 -0800)]
dragon armor fix

Fix a segfault when polymorphed into a dragon and using ^X.

One inconsistency I've spotted that I hadn't noticed earlier:  if
you wear red dragon scales/mail you obtain infravision ability, but
if polymorph into a red dragon, you don't.

3 years agodragon armor properties
PatR [Sat, 25 Dec 2021 18:26:44 +0000 (10:26 -0800)]
dragon armor properties

Special abilities conferred by wearing dragon armor was implemented in
a somewhat half-assed fashion; extend it to 3/4-assed.  Abilities came
from wearing dragon armor but not from being poly'd into a dragon or
for monsters that were wearing dragon armor or actually were dragons.
This covers much of that.

There are umpteen calls of 'resists_foo(mon)' and some are now
'resists_foo(mon) || defended(mon, AD_FOO)' but the second part ought
to be incorporated into update_mon_intrinics() so that the extra
'|| defended()' doesn't have to be spread all over the place and the
ones being put in now could/should be removed.

While testing, I noticed that a monster wielding Fire Brand did not
resist being hit by a wand of fire.  This fixes that and should also
fix various comparable situations for other artifacts.  But so far it
has only been done for zapping (and any other actions which use the
zapping code).  Folding defended() checks into update_mon_intrinsics()
matters more than that probably sounds.