]> granicus.if.org Git - nethack/log
nethack
4 years agoStock all special rooms at the end of level creation
copperwater [Fri, 22 May 2020 04:02:51 +0000 (00:02 -0400)]
Stock all special rooms at the end of level creation

This unifies the two separate special-room-stocking code paths, one in
the standard dungeon generator and one in the special level generator
(neither of which reacted to themed rooms, which is the reason for this
commit) into the end of makelevel(), placing the special room stocking
as the very last step of level creation.

Under the new system, when a regular or special level decides to create
a special room, it sets that room's rtype, but the room is not stocked
until later. It already worked this way for special levels, so the main
difference here is in the normal level generation, where the mkroom
family of functions identifies and marks a room as a special room, but
stops short of filling it. (I suppose perhaps the mkroom, mkzoo, mkshop
family of functions would be better off changing their names to
"pickroom" and so on.)

This also restructures makelevel() itself a bit, but the only real
change is that the paths that call makemaz don't return immediately
afterward; they continue to the special room stocking code. Also, this
code was lifted from fill_special_rooms, which is now not used
anywhere, so it has been deleted.

I don't really like how fill_ordinary_room is in mklev.c and
fill_special_room is in sp_lev.c; they seem like they'd be better off in
mkroom.c, but in the interest of not making unnecessary code changes,
I'll just recommend it.

4 years agoMove Orcus shopkeeper removal from fixup_special into stock_room
copperwater [Fri, 22 May 2020 01:04:06 +0000 (21:04 -0400)]
Move Orcus shopkeeper removal from fixup_special into stock_room

The plan is to unify special room filling code and cause special rooms
to be filled as the very last stage of level creation. Since this will
occur after fixup_special, it was necessary to address the one remaining
piece of code in there that affects special room filling. (The Medusa
code remaining in there doesn't have to do with special rooms.)

4 years agoAdjust rooms in Medusa levels to account for player monster statues
copperwater [Thu, 21 May 2020 17:23:41 +0000 (13:23 -0400)]
Adjust rooms in Medusa levels to account for player monster statues

There is code in fixup_special for stocking Medusa's lair with statues
of players from the leaderboard. It makes two assumptions: that there
will always be at least one room defined on Medusa's level, and that
the statues should be placed in the first room defined. In the process
of removing prefilled, some of these rooms suddenly became non-rooms,
and this caused problems. This commit ensures that the regions for
turning into rooms to hold the statues are present and come first.

In the process of writing this commit, I discovered a bug: the statue
stocking code for medusa in fixup_special naively chooses the spot at
which to place its final statue by selecting independent x and y
coordinates with somex and somey. This is responsible for a statue
occasionally being embedded in a wall or in iron bars on medusa-2 and
medusa-4: the rooms defined to receive statues are irregular, and some
of the possible coordinates happen to be walls, bars, and water.

The proper fix here is to add lua functionality so that the level
designer can specify that they want a leaderboard corpse or statue, and
remove the medusa special case from fixup_special, but that's rather
out of scope for what I'm doing here.

4 years agoFill special rooms recursively rather than only at top level
copperwater [Thu, 21 May 2020 12:48:24 +0000 (08:48 -0400)]
Fill special rooms recursively rather than only at top level

The fill_special_rooms function was only stocking two types of rooms:
top-level rooms in g.rooms, and their immediate subrooms. If there were
a special room 2 or more levels down, it would not get filled. (No
special levels currently define such a special room, so this bug is
latent.)

To address this, I changed fill_special_rooms to iterate only through
the top level rooms, and fill_special_room to recurse through all of its
subrooms (if any) before filling itself.

4 years agoUnify all special level filling options
copperwater [Tue, 19 May 2020 04:13:41 +0000 (00:13 -0400)]
Unify all special level filling options

The existing system was a confusing mess of competing names (filled,
needfill, prefilled, etc) that had varying semantics, with prefilled
being the worst offender as it meant at least three different things in
various contexts. This commit unifies everything in the code under
"needfill", and everything in Lua under "filled", which defaults to 0
everywhere.

This also removes the second argument to fill_special_room; that
function now just checks the needfill of the room it's passed. As
before, a filled == 2 value is used for a special room to indicate that
the room should set the appropriate level flag, but shouldn't actually
be stocked with anything (for instance, King Arthur's throne room); the
difference is that this now comes directly from the lua script instead
of being manipulated within sp_lev.c.

The prefilled argument had one use case that is occasionally used in the
level files: if the level designer had specified an ordinary region with
prefilled = 1, it would become a room to control monster arrivals on a
level -- monsters that arrive within the bounds of a room are supposed
to stay there.
However, not all of the places where the comments indicated this was
being used were using it correctly; I tested this by letting a few
monsters fall through the knox portal (they're supposed to be
constrained to the entry room) and waiting a hundred turns, then going
through the portal; they were not constrained to the room and had
"wandered" through its walls.
Instead of trying to maintain this special case, I have added an
optional "arrival_room" boolean argument to des.region, which forces it
to create a room for the purposes of constraining monster arrival.

I have gone through and replaced occurrences of prefilled in lua files
with the appropriate filled option (or arrival, as needed). In some
cases, that resulted in questionable regions such as a filled ordinary
area in a non-themeroom (I just dropped the filled=1), or an area which
didn't do anything, not even lighting (which I deleted).

4 years agoMake fill_special_room avoid themed rooms
copperwater [Mon, 18 May 2020 01:47:10 +0000 (21:47 -0400)]
Make fill_special_room avoid themed rooms

No code in this function would actually do anything if it were called on
a themed room, but since it is pretty clearly intended for the "regular"
special rooms, it's probably best to explicitly avoid themed rooms as
well.

4 years agoAllow themed room subrooms to be filled
copperwater [Mon, 18 May 2020 01:21:10 +0000 (21:21 -0400)]
Allow themed room subrooms to be filled

I noticed that any subrooms created within a themed room were bare -
they never had any monsters, objects, traps, or anything really,
regardless of whether filled = 1 was set on them. As a result, they're
pretty boring.

It turns out that the code in makelevel() responsible for stocking
ordinary rooms with stuff only looped through g.rooms, and completely
ignored subrooms. (Subrooms would not get stocked with items by virtue
of being part of the larger room; I tested this by dialing the item
generation in rooms way up, and none of those items ever got placed in a
subroom.)

To fix this, I've extracted the code that populates an ordinary room
into its own function, fill_ordinary_room, and made it recurse into its
own subrooms. (I also renamed fill_rooms and fill_room to include the
word "special" in their names, because they only deal with special
rooms.) Note that since special rooms follow a separate codepath, an
ordinary subroom of a special room won't get stocked; perhaps these
functions should be unified in the future.

The fill_ordinary_room code is pretty much a verbatim cut and paste from
makelevel, so there is not currently any consideration for the size of
the subroom or the fact that it is a subroom with respect to how many
monsters, traps, objects, etc get placed.

I'm not sure whether other things such as stair selection will ever
select themed room subrooms, or whether they too only look at g.rooms.

4 years agoFix the "stuck pets" bug (github issue #329)
copperwater [Fri, 18 Sep 2020 23:10:54 +0000 (19:10 -0400)]
Fix the "stuck pets" bug (github issue #329)

This commit is intended to fix the bug where a pet will get fixated on
an unmoving monster and stop moving itself. I described the cause in the
github issue; the gist is that the pet AI chooses the unmoving monster
as its ranged target, doesn't do anything when it calls mattackm
(because it doesn't have ranged attacks), then returns a value
indicating it didn't move and can't take further actions.

I initially implemented a fix that refactored mattackm to distinguish
between "attacker missed" and "attacker did nothing", which the pet AI
could then use to determine whether the pet could continue doing things.
But then I realized that if mattackm is called with non-adjacent
monsters, a return of MM_MISS more or less unambiguously indicates that
the attacker did nothing (because the ranged functions it calls like
breamm don't actually check to see whether the target was hit, just
whether the monster initiated the attack.) So, this only really needed
to check whether mattackm returned with MM_MISS.

I also found a probable bug in mattackm, in that the thrwmm call isn't
treated the same as breamm or spitmm. In the latter two, mattackm
returns MM_HIT even though it doesn't check whether the ranged attack
actually hit its target. But there was no logic doing the same for
thrwmm, so this commit also adds that. (Otherwise, a pet could possibly
use a ranged weapon attack and then get to keep moving on its turn.)

4 years agoQt popup_dialog tinkering
PatR [Sun, 27 Sep 2020 02:35:37 +0000 (19:35 -0700)]
Qt popup_dialog tinkering

Some changes to the YnDialog widget used when popup_dialog is On.

If a button is labelled with a space, it just looks like an
unlabelled button.  Switch to "Spc" for space, "Ent" for \n and
"Ret" for \r.  (The last two aren't completely logical but I
haven't seen any dialogs that need them and they'll be better
than "^J" and "^M" if there are such.)

For yn#aq dialogs, preload a grayed-out "#" in the count widget.
Just for show; has no tangible effect.

The count widget should return long rather than plain int.

4 years agopeacefuls witnessing attack against peaceful mon
PatR [Thu, 24 Sep 2020 07:44:07 +0000 (00:44 -0700)]
peacefuls witnessing attack against peaceful mon

The short exclamations ("Gasp!", "Why?", &c) led to ambiguity
about which monster was vocalizing them.  Use full sentences
which refer to the speaker.  It can become quite a bit more
verbose but is less likely to lead to confusion.  Perhaps it
should cut those off after a modest number of them have been
issued?

4 years agopull request #345 - theme room dimensions
PatR [Thu, 24 Sep 2020 00:57:19 +0000 (17:57 -0700)]
pull request #345 - theme room dimensions

"When a room is created and passed down to a contents function in
Lua, the width and height properties of that room are computed by
subtracting lx from hx and ly from hy, which means e.g. a room
which is 8 floor squares wide and 5 tall appears to the contents
function as having a width of 7 and height of 4.  This patch fixes
that off-by-one."

I don't understand the details here:  should a room's dimensions
include its boundary walls or just the inner amount?  This change
didn't seem to cause any problems so I've put it in.

Closes #345

4 years agoQt's 3.6 status conditions
PatR [Wed, 23 Sep 2020 23:40:26 +0000 (16:40 -0700)]
Qt's 3.6 status conditions

Replace the blank placeholder icon with individual placeholders
for Stone, Slime, Strngl, Deaf, Lev, Fly, and Ride.  They're just
40x40 tiles showing solid color (different for each) holding white
block letters spelling the condition.  For the first four of those,
the text runs from upper-left to lower-right, for Lev and Fly the
text runs from lower-left towards upper-right, and for Ride it's
horizontal.  Not particularly exciting but better than blank.  We
still need real artwork to make them be similar to the older
conditions.

Also moves the two petmarks and the pilemark from qt_xpms.h to
qt_map.cpp.  The marks and the assorted status icons are all
static arrays, and including that header in two source files
meant that they were all duplicated unless the compiler or linker
was smart enough to discard the unused ones.

4 years agoQt status fix: 'showexp'
PatR [Wed, 23 Sep 2020 12:21:31 +0000 (05:21 -0700)]
Qt status fix: 'showexp'

For Qt, experience points weren't shown when enabling 'showexp'
option because they were conditional upon '#if EXP_ON_BOTL'.  That
got eliminated prior to 3.6.0 so wasn't defined for qt_stat.cpp.

When displayed, show Exp as Level:Xp/Exp instead of as a separate
status field.  This has the intentional side-effect of omitting it
when hero is polymorphed and status shows HD instead of Xp.

Label the six characteristics in mixed case instead of all upper
case:  Str, Dex, and so forth.

4 years agomakedefs: hide conditionally unused routine
PatR [Wed, 23 Sep 2020 10:03:46 +0000 (03:03 -0700)]
makedefs: hide conditionally unused routine

Avoid a new build warning for the default configuration.

4 years agowhitespace bit
nhmall [Tue, 22 Sep 2020 14:28:22 +0000 (10:28 -0400)]
whitespace bit

4 years agofollow-up bit; ensure the mkstemp() file is unlinked
nhmall [Tue, 22 Sep 2020 14:11:51 +0000 (10:11 -0400)]
follow-up bit; ensure the mkstemp() file is unlinked

4 years agounique temp files for makedefs invocations (GitHub issue #391)
nhmall [Tue, 22 Sep 2020 13:03:15 +0000 (09:03 -0400)]
unique temp files for makedefs invocations (GitHub issue #391)

As reported in https://github.com/NetHack/NetHack/issues/391
if make was invoked with -j, makedefs instances could end up running in
parallel and could trample on each other's grep.tmp tempory files.

Default to using mkstemp(); allow a port runtime library implementation
that lacks mkstemp() to define HAS_NO_MKSTEMP to revert to the old behaviour.

Provide a work-alike mkstemp() implementation for windows Visual Studio build
in mdlib.c so there is no requirement to define HAS_NO_MKSTEMP there.

Fixes #391

4 years agofix #K2203 - animals can talk
PatR [Mon, 21 Sep 2020 01:38:31 +0000 (18:38 -0700)]
fix #K2203 - animals can talk

The code for peaceful monsters witnessing the hero attack another
peaceful monster and getting angry had a 20% of making them gasp in
surprise or exclaim "why?" in shock.  It was only requiring them to
have humanoid shape rather than checking for speech capability, so
peaceful zruty or minotaur, possibly other animals, could exclaim
comprehensibly.  Other things which shouldn't talk, like mummies,
would behave similarly.

This categorizes how a bunch of MS_foo types should react.  It has
only been lightly tested.

4 years agoQt non-issue
PatR [Sat, 19 Sep 2020 00:30:48 +0000 (17:30 -0700)]
Qt non-issue

Any key bindings in player's run-time config file will already be
in place by the time the Qt menus are constructed.  Those menus
will use the new key assignments rather than the defaults, so not
a bug.

4 years agofix pull request #386 - monster interaction
PatR [Fri, 18 Sep 2020 22:53:43 +0000 (15:53 -0700)]
fix pull request #386 - monster interaction

The previous teleport scroll fix was mislabeled with this pull
request number.  Too late to fix that now; should have been

Closes #307

Now...  Interaction between voluntarily busy hero (resting,
searching, and so on) with approaching monsters to decide whether
to stop had some inconsistencies.

Really closes #386

4 years agopull request #386 - discovering teleport scroll
PatR [Fri, 18 Sep 2020 22:34:29 +0000 (15:34 -0700)]
pull request #386 -  discovering teleport scroll

Since teleporation gives a "you matrialize" message even when
arriving close by, the old behavior of not learning a scroll of
teleportation when you land quite close to your original spot
no longer made sense.  Always [almost] discover teleport scroll
when reading it.

Also adds one-shot teleport control when reading a blessed scroll
of teleportation.  I changed that to be prevented when hero is
stunned, same as with full-fledged teleport control.

I reworded or reformatted several of the comments.  And removed
the EDITLEVEL increment in patchlevel.h; save and bones file
contents are not affected.

I've also added an unrelated comment about reading mechanics to
doread().

Closes #386

4 years agoanother Qt "issue"
PatR [Fri, 18 Sep 2020 02:02:23 +0000 (19:02 -0700)]
another Qt "issue"

4 years agomore Qt menu
PatR [Thu, 17 Sep 2020 17:47:33 +0000 (10:47 -0700)]
more Qt menu

The #enhance menu revealed a couple of menu problems for Qt.

Items flagged with "*" or "#" were showing tiny "..." instead of
the flag character.  An existing problem rather than something
caused by yesterday's overhaul patch.

The "(Skills flagged by "*" may be enhanced when you're more
experienced.)" legend line was causing the regular entries to be
formatted strangely (their skill name column was much too wide).
That was caused by me dropping something (special case for header
lines during tab-separation handling) in yesterday's patch that
I mistakenly thought wasn't needed.

4 years agosilence a Qt complaint
PatR [Thu, 17 Sep 2020 09:49:37 +0000 (02:49 -0700)]
silence a Qt complaint

The save file selection widget was issuing a complaint to stderr:
|QLayout: Attempting to add QLayout "" to QDialog "", which already
| has a layout

This shuts that up, but doesn't fix the broken save file selection
so I haven't added a fixes37.0 entry.

4 years agoQt menu overhaul
PatR [Wed, 16 Sep 2020 22:51:33 +0000 (15:51 -0700)]
Qt menu overhaul

handle preselected item in pick-one menu; picking it returns that
  item rather than toggling it off and returning nothing, picking
  something else only returns the other thing (was returning first
  of the chosen item or the preselected item, foiling core's attempt
  to deal with both and giving wrong result whenever the preselected
  one came first--like pick-an-attribute for menu colors);

when handling typed input, check selector letters before menu
  command keys so that special "letters" '-' (fingers, hands, self)
  and ':' (look inside container) that are specified by a few menus
  can be chosen by keyboard;

menus were using default line heights which are excessively tall,
  effectively making them be double spaced and using more screen
  space than should have been needed; reduce height to 60% of what
  it was, still a bit taller than regular spacing; look at ^X--which
  is rendered via menu--before and after to see the difference;

start with count column empty instead of 6 spaces; grow it as counts
  get entered; reset to empty if [all], [none], or [invert] is used;
  treat intermediate counts as long rather than int; right justify
  formatted count values;

simplify creating menu return data (pick-one doesn't need separate
  handling);

for pick-one menus,
  enable [ok] button if there is one preselected item,
  enable [all] button if there is only one item (may never happen),
  enable [none] if there is a preselected item (menu remains active
    if [none] is used to clear the preselection);
  enable [invert] if there is one item (may never happen; should
    allow two items if one of them is preselected--definitely does
    happen--but that wouldn't work as intended without code changes);

honor pending count if an item is selected by clicking its checkbox
  (already done for typing its letter or for clicking another part
  of item's menu line);

accept <delete>/<rubout> in addition to <backspace> when backing out
  a digit as a count is being typed;

accept ^[ as well as ESC key for cancelling count or entire menu;

honor 'menucolors'=false to ignore any defined menu color patterns.

4 years agonew file win/Qt/Qt-issues.txt
PatR [Wed, 16 Sep 2020 09:04:15 +0000 (02:04 -0700)]
new file win/Qt/Qt-issues.txt

Record a bunch of Qt stuff before I forget it all.  It's probably
too late:  I'll bet I've left some things out.

Doesn't include several menu problems that I've already fixed but
not checked in yet.  (I don't have any other Qt changes pending.)

4 years agounexplored terrain on Qt map
PatR [Tue, 15 Sep 2020 14:26:42 +0000 (07:26 -0700)]
unexplored terrain on Qt map

Qt's map hadn't been updated to draw unexplored locations with
the unexplored glyph so was still using solid stone instead.

Column 0 should be removed but I'll leave that for someone more
adventurous; I did it for curses and for X11 but am going to
pass here.  It's very noticable after magic mapping but is only
"bad" (by wasting space) if clipping is being performed.

4 years agohistory formatting
PatR [Tue, 15 Sep 2020 10:51:20 +0000 (03:51 -0700)]
history formatting

Qt's text window for 'history' was unexpectedly wide and it turned
out that that was to fit in one excessively wide line.  tty has
been formatting it by splitting it into one normal sized line
followed by an excessively short line.

4 years agopick-a-color tweak
PatR [Sat, 12 Sep 2020 06:59:20 +0000 (23:59 -0700)]
pick-a-color tweak

Move a minor conditional out of a short loop.  I only bothered
because I wanted to fix a comment.

4 years agosyntax bit
nhmall [Sat, 12 Sep 2020 04:32:05 +0000 (00:32 -0400)]
syntax bit

4 years agopick-a-color in color
PatR [Thu, 10 Sep 2020 23:01:18 +0000 (16:01 -0700)]
pick-a-color in color

Similar to how the pick-an-attribute menu for menu colors and
status highlights shows the attribute names using the attribute
so that you can see how it looks (or whether it is supported),
have the pick-a-color menu show the color names in the
corresponding color.  Does so by temporarily removing any
user-specified menu colors and setting up another list of such
for matching color names.

Forces the 'menucolors' option On while the pick-a-color menu is
in use, then restores the previous setting along with the user's
menu colorings.  Might need some way to avoid setting that for a
configuration where colors don't work.

4 years agohints/*.2020 vs CFLAGS, take 3...
PatR [Wed, 9 Sep 2020 21:40:22 +0000 (14:40 -0700)]
hints/*.2020 vs CFLAGS, take 3...

Avoid use of GNU make's 'override' feature by requiring
'make CCFLAGS=-O' to replace -g from the make command line instead
of 'make CFLAGS=-O'.  Note the extra 'C' in the spelling.

Revert the previous umpteen MORECFLAGS+= back to normal CFLAGS+=.

4 years agoboolean option processing
PatR [Wed, 9 Sep 2020 21:19:48 +0000 (14:19 -0700)]
boolean option processing

In addition to 'true', 'yes', 'on' and 'false', 'no', 'off',
accept 1 and 0 for the value of a boolean option.  Other numeric
values are rejected rather than treated as non-zero.

Relax the parsing for true, false, yes, no to accept one or more
letters instead of requiring at least three for true and false
and full word for yes and no.  Full word is still required for
on and off.

Don't report two errors for the same mistake:
 |% NETHACKOPTIONS='legacy:flase' ./nethack
 | * Illegal parameter for a boolean.
 | * Unknown option 'legacy:flase'.
 |2 errors in NETHACKOPTIONS.
is changed to
 | * 'legacy:flase' is not valid for a boolean.
 |1 error in NETHACKOPTIONS.

4 years agoqt_map.cpp source formatting
PatR [Tue, 8 Sep 2020 20:26:13 +0000 (13:26 -0700)]
qt_map.cpp source formatting

Clean up the Qt code a bit.  The only intended change is to use
a different check for being polymorphed.

4 years agohints/{linux,macOS}.2020
PatR [Tue, 8 Sep 2020 19:36:13 +0000 (12:36 -0700)]
hints/{linux,macOS}.2020

A recent change was intended to allow specifying
  make CFLAGS=-O
on the command line to override our default of -g, but it didn't
work as intended.  foo=bar and foo+=bar don't work if foo has
been given a value on the command line.  The first was expected
behavior but the second wasn't, at least for me.  GNU make allows
'override foo+=bar' to cope with that.  (We're already implicitly
requiring GNU make for the linux and OSX hints.)

4 years agofix #K1963 - warning after placing worm tail
PatR [Tue, 8 Sep 2020 10:03:03 +0000 (03:03 -0700)]
fix #K1963 - warning after placing worm tail

Report described this as a panic triggered by the sanity_check
option, but that's because it was running under the fuzzer, which
escalates any impossible() to panic(), rather than because nethack
panicked.

I couldn't find anything wrong--which doesn't mean that there
isn't something wrong--with place_worm_tail_randomly() and
random_dir().  They use xchar for map coordinates which should be
fine as long as no negative values are generated and I couldn't
discover any such.  The suggested fix of changing xchar to int
might indicate a compiler bug (although the odds of that are low).
The bogus coordinate of -15000 in the report suggests that
 typedef short int schar;
(which changes xchar too) is being used in the configuration but
I don't recall having any problems attributable to that.

This switches from xchar to int as a side-effect of replacing the
offending code entirely.  The new code might produce an 'ny' of -1
before goodpos() rejects it, so xchar would be inappropriate now.
The old code is commented out via #if 0 _after_ changing it from
xchar to int.

This also adds an extra sanity_check for worm tails, unrelated to
the current bug.  I'm not aware of any instance where it fails.
EXTRA_SANITY_CHECKS needs to be defined for it to do anything.

4 years agospecial level's lit state when changing terrain
PatR [Sun, 6 Sep 2020 23:17:33 +0000 (16:17 -0700)]
special level's lit state when changing terrain

Part of pull request #308:  when using des.terrain to set terrain,
default for lit state becomes 'unchanged' rather than 'unlit'.
des.replace_terrain already operates that way.  Replace lit state
magic numbers -1 and -2 with SET_LIT_RANDOM and SET_LIT_NOCHANGE.

Also change SET_TYPLIT() to not operate on map column 0 and move
it from rm.h to sp_lev.h.  It never belonged there, is only used
in sp_lev.c, and now because of the SET_LIT_ macros it couldn't be
used anywhere else unless sp_lev.h gets included too.

4 years agoupdate unix Makefile hints
PatR [Sat, 5 Sep 2020 20:28:46 +0000 (13:28 -0700)]
update unix Makefile hints

4 years agopolearm context
PatR [Sat, 5 Sep 2020 18:35:28 +0000 (11:35 -0700)]
polearm context

Move clearing of polearm context from migrate_to_lev() to lower
level relmon().  Add missing transfer of polearm context from
old mon to new mon in replmon().  These days it seems to only be
used for creating a monster from saved traits, so polearm context
in it should be moot.

4 years agomore hunger checks
PatR [Fri, 4 Sep 2020 22:29:22 +0000 (15:29 -0700)]
more hunger checks

I don't know what I was thinking before.  'moves + rn2(20)' can
be simplified to just rn2(20) and ignore moves altogether.

4 years agohunger checks
PatR [Fri, 4 Sep 2020 21:31:44 +0000 (14:31 -0700)]
hunger checks

Eliminate the feasibility of micro-managing ring hunger by swapping
back and forth between a pair of rings of slow digestion.  Wearing
one at a time causes normal ring hunger (wearing both at once just
increases such hunger), but being able to put on the second ring
and take off the first just before the 1 out of 20 turns where it
affects hunger, then vice versa a few turns later, is an insanely
tedious way to avoid any hunger at all, made possible by the 'time'
option.  Make the turns where extra hunger get imposed be randomized
so that that can't be done reliably.

Also closes githib issue #336:  hunger caused by melee attacking
adds ring and amulet hunger a second time for that turn.  That has
always been intentional behavior; now the amount varies for any
given attack due to the randomization, but on average is the same
as before.

Closes #336

4 years agoQt input overhaul
PatR [Fri, 4 Sep 2020 02:01:36 +0000 (19:01 -0700)]
Qt input overhaul

Enable existing wc_popup_dialog option.  Use it in yn_function()
instead using a mystery value which apparently used to live in Qt
Settings but isn't there anymore so couldn't be turned on or off.
Also replaces conditional USE_POPUPS which isn't defined anywhere
either so presumably came from CFLAGS and only supported "yn?",
"ynq?", and "rl?" with hardcoded Qt popups rather than using
NetHackQtYnDialog.

Doing that revealed that the popup dialog for ynaq was in pretty
bad shape.  It's functional but still needs a lot of work, beyond
the limited Qt/C++ capability I possess.  The KeyPress issue which
accepts <shift> as input, thereby preventing <shift>+<character>
from being typed during ynaq prompting, is particularly nasty.

Append the ynaq dialog's response to the message line containing
the corresponding prompt similar to what's now done for regular
yn_function().

Add getlin() prompt+response to the message window.

4 years agopotential infinite loop on hangup (ring prompt)
PatR [Tue, 1 Sep 2020 11:11:01 +0000 (04:11 -0700)]
potential infinite loop on hangup (ring prompt)

Core issue noticed while working on some Qt stuff.  If hangup
occurred while prompting for "right or left?" ring finger, the
hangup yn_function() would return ESC and the accessory-on routine
would not see '\0', 'r', or 'l' so reprompt.  Endlessly.

4 years agoQt without tiles again
PatR [Mon, 31 Aug 2020 22:47:49 +0000 (15:47 -0700)]
Qt without tiles again

"Qt without tiles" (commit ae4c180cf62ce4f19bd020495d6b089584b2426b)
two weeks ago accidentally took out a line that should have stayed.

4 years agoQt prompt responses in message window
PatR [Mon, 31 Aug 2020 07:30:36 +0000 (00:30 -0700)]
Qt prompt responses in message window

When Qt issues a prompt string in the message window, update it
with the player's response once that has been obtained.

4 years agoQt message [un]highlighting
PatR [Mon, 31 Aug 2020 05:50:02 +0000 (22:50 -0700)]
Qt message [un]highlighting

The Qt interface highlights the last message issued (using a
mechanism for selection, as if for copy+paste or similar operation)
but it was staying highlighted until another message was eventually
given.  Having an old message seem to stick around is annoying and
is particularly bad when the message is a prompt.  If the player's
answer doesn't cause a message to be shown then it seems as if the
prompt is still pending.

This removes the highlighting (by bulk unselecting) once the player
gives another input keystroke or mouse click.

It would be much better if the selecting/highlighting was for all
messages issued since last time highlighting was cleared.  Figuring
out how to do that correctly is more effort than I want to expend.

4 years agoQt keyboard fixups
PatR [Sun, 30 Aug 2020 23:44:39 +0000 (16:44 -0700)]
Qt keyboard fixups

Make ASCII control characters ^[, ^\, ^], ^^, and ^_ work on Qt,
at least partly.  Mainly for ^[ to be treated as ESC, which works
if you're aborting a count on the map but doesn't cancel out of
menus [yet?].  I didn't attempt to make ^@ send NUL.

Also, fix the hardcoded macros (activated by F1: rest 100 turns,
F2: search 20 times, and Tab: ^A to do-again).  The first two sent
'n' before the count so wouldn't work as intended with number_pad
off, and the third was executing twice as if Tab sent two ^A's
instead of just one.  Resting and searching might have been getting
duplicated too; I don't know how to simulate the relevant keys.
(I temporarily swapped definitions for F2 and Tab to test the
number_pad fix but hadn't done that earlier when I discovered the
Tab bug.)

4 years agoqt_win.cpp cleanup
PatR [Sun, 30 Aug 2020 23:00:18 +0000 (16:00 -0700)]
qt_win.cpp cleanup

Started out fixing a comment typo and ended up removing a bunch of
unnecessary stuff, plus a little bit of lackluster reformatting.

4 years agoQt menu fix
PatR [Sat, 29 Aug 2020 00:31:33 +0000 (17:31 -0700)]
Qt menu fix

Menus have [ok], [cancel], [all], [none], [invert], and [search]
buttons across their top but the [all], [none], and [invert] choices
didn't redraw the menu after making changes to the pending selections
so it seemed as if they weren't doing anything.  Subsequently picking
[ok] revealed otherwise.

[search] is broken (instead of accepting a search string, the letters
I type are being used to toggle individual entries as I type).  This
doesn't attempt to address that.

4 years agofix pull request #379 - is_displacer()
PatR [Fri, 28 Aug 2020 00:38:11 +0000 (17:38 -0700)]
fix pull request #379 - is_displacer()

A couple of places which could/should have been using existing
is_displacer() macro weren't.

No change in behavior.

Fixes #379

4 years agofix pull request #380 - turning into slime
PatR [Thu, 27 Aug 2020 23:14:17 +0000 (16:14 -0700)]
fix pull request #380 - turning into slime

The turn-to-slime countdown is one of the ones that uses turns/2
to stretch the sequence out longer and it was displaying the hero
as green slime when there was another turn before it happened.
(In theory anyway.  I could not get my hero to be shown as slime
and still have one move left, even when hasted.)

Make the hero mimic green slime starting on the last turn before
being polymorphed instead of next to last.

Fixes #380

4 years agofix commented-out debugging code
PatR [Wed, 26 Aug 2020 21:47:02 +0000 (14:47 -0700)]
fix commented-out debugging code

I was actually using fprintf(stderr,...) when testing and didn't
retry this bit after changing it to raw_printf(...).  It's commented
out but needs fixing.

4 years agosys/winnt/Makefile.msc update for VS 2019 16.7.2
nhmall [Wed, 26 Aug 2020 02:41:54 +0000 (22:41 -0400)]
sys/winnt/Makefile.msc update for VS 2019 16.7.2

4 years agoqt_key.cpp
PatR [Wed, 26 Aug 2020 01:59:22 +0000 (18:59 -0700)]
qt_key.cpp

I've been trying to figure out how to make ^[ be treated as ESC but
so far have failed.  That key combination just acts like a dead key.
But one bit of cp_key.cpp can be implemented instead of ignored.

No change in behavior because the keyboard-state value isn't being
used anywhere.

4 years agoQt tombstone bugs
PatR [Thu, 20 Aug 2020 23:56:50 +0000 (16:56 -0700)]
Qt tombstone bugs

Infrastructure bits:  Qt tombstone uses a short buffer; make sure that
the plname value fits instead of relying on snprintf() to truncate it.
A warning about gold, if any, was iffy but this should guarantee no
reason for future complaint.  Year was safe but a compiler sensitive
to buffer overflows wouldn't know that.

Actual bugs:  Qt used money in inventory for gold amount on tombstone;
that overlooks gold in containers and will be 0 by tombstone stage if
bones get saved.  Year was recalculated from current date+time instead
of using the value that gets passed in--blindly flagging that variable
as UNUSED was a mistake.

4 years agoMerge branch 'NetHack-3.7'
nhmall [Thu, 20 Aug 2020 15:20:26 +0000 (11:20 -0400)]
Merge branch 'NetHack-3.7'

4 years agobuild warning fix on g++ >= 9 and Qt
nhmall [Thu, 20 Aug 2020 15:18:32 +0000 (11:18 -0400)]
build warning fix on g++ >= 9 and Qt

../win/Qt/qt_menu.cpp: In member function ‘virtual void nethack_qt_::NetHackQtTextWindow::UseRIP(int, time_t)’:
../win/Qt/qt_menu.cpp:680:54: warning: ‘%s’ directive output may be truncated writing up to 31 bytes into a region of size 17 [-Wformat-truncation=]
  680 |     snprintf(rip_line[NAME_LINE], STONE_LINE_LEN+1, "%s", g.plname);
      |                                                      ^~   ~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from ../win/Qt/qt_menu.cpp:8:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin_snprintf’ output between 1 and 32 bytes into a destination of size 17
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~../win/Qt/qt_menu.cpp: In member function ‘virtual void nethack_qt_::NetHackQtTextWindow::UseRIP(int, time_t)’:
../win/Qt/qt_menu.cpp:680:54: warning: ‘%s’ directive output may be truncated writing up to 31 bytes into a region of size 17 [-Wformat-truncation=]
  680 |     snprintf(rip_line[NAME_LINE], STONE_LINE_LEN+1, "%s", g.plname);
      |                                                      ^~   ~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from ../win/Qt/qt_menu.cpp:8:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin_snprintf’ output between 1 and 32 bytes into a destination of size 17
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

4 years agogrammar bit
nhmall [Thu, 20 Aug 2020 13:50:07 +0000 (09:50 -0400)]
grammar bit

4 years agocomment out what appears to be an obsolete bit in windows Makefile.gcc
nhmall [Tue, 18 Aug 2020 14:36:15 +0000 (10:36 -0400)]
comment out what appears to be an obsolete bit in windows Makefile.gcc

4 years agomirror recent make depends update in some other Makefiles
nhmall [Tue, 18 Aug 2020 14:26:24 +0000 (10:26 -0400)]
mirror recent make depends update in some other Makefiles

4 years agoQt without tiles
PatR [Mon, 17 Aug 2020 23:42:24 +0000 (16:42 -0700)]
Qt without tiles

Qt is capable of using an ascii map, and does so on the rogue level.
So failing to load tiles doesn't need to quit; it can continue in
text mode.

Not extensively tested.  This disables the paper doll when the ascii
map is forced (either via options settings or due to tiles loading
failure, but not when simply on the rogue level) rather than trying
to display it with object class characters.

4 years agoQt install dependencies
PatR [Mon, 17 Aug 2020 22:53:18 +0000 (15:53 -0700)]
Qt install dependencies

Playground setup:  Qt does not use external files pet_mark.xbm and
pilemark.xbm, it has pixmaps for those compiled in via qt_xpms.h.
Presumably because the pet mark heart has two sizes there.

4 years agowin/Qt/* dependencies update
PatR [Mon, 17 Aug 2020 22:44:16 +0000 (15:44 -0700)]
win/Qt/* dependencies update

A couple of qt_*.h headers now include other qt_*.h headers,
adding a bunch of new dependencies for the qt_*.cpp sources.
This is from 'make depend'.

4 years agoQt: paper doll display of BUC status
PatR [Mon, 17 Aug 2020 22:41:33 +0000 (15:41 -0700)]
Qt: paper doll display of BUC status

When items in the paper doll inventory subset (primary worn and
wielded items) have known BUC state, indicate what that is.  It
now draws a one pixel wide white border around each doll tile,
and if BUC is known, that border gets its color changed (red for
known cursed, yellow for known uncursed, cyan for known blessed).
That isn't very visual so the first pixel inside the tile is
overwritten with the same color, and alternating pixels are also
overwritten for the second rectangle within.  The 2..3 pixel wide
border is visible without cluttering the tile for 'normal' sized
paper doll.  The tiles are allowed to be scrunched down to as
small as 6x6 so there won't be much left after 1 or 2 around the
edge are replaced.

Initially I was going to try to highlight welded items but the
more general BUC highlighting is simpler and usually more useful
to the player.

The qt_map.* bits are just reformatting.  I was looking at pet
and pile annotations as a way to do BUC annotations but decided
not to attempt that.

4 years agopaper doll inventory display vs hallucination
PatR [Mon, 17 Aug 2020 21:48:00 +0000 (14:48 -0700)]
paper doll inventory display vs hallucination

During hallucination, actions which triggered update of persistent
inventory made Qt's display of map tiles for equipped objects have
those tiles switch randomly, but ordinary move-by-move fluctations
applied to floor objects left them alone.

Initially I took out hallucination of inventory items altogether,
but ended up putting that back and changing the floor hallucination
to affect Qt's paper doll too.  The display.h change isn't needed
but I've left it in.

4 years agoQt "Paper Doll" inventory
PatR [Sun, 16 Aug 2020 02:48:33 +0000 (19:48 -0700)]
Qt "Paper Doll" inventory

Enhance the "Qt Settings" dialog box to provide control over the
paper doll subset of inventory displayed between the message and
status windows (above the map).  A ton of flailing about for a
fairly small but useful change in functionality.

Old dialog (no title):
| [ ] Zoomed            -- check box
| "Width:"  [      ]    -- number entry spinner
| "Height:" [      ]    -- ditto
| "Font:"   [      ]    -- Huge:18pt, Large:14, Medium:12, Small:10, Tiny:8
| [      Dismiss      ] -- button

New dialog:
|     "Qt NetHack Settings"
|
| "Map:"    [ ] "Zoomed"        -- check box
|           "Tile Width"   [  ] -- number entry spinner
|           "Tile Height"  [  ] -- ditto
| "Invent:" [ ] "Shown"         -- check box
|           "Doll Width"   [  ] -- number entry spinner
|           "Doll Height"  [  ] -- ditto
| "Font:"   [      ]    -- Huge:18pt, Large:14, Medium:12, Small:10, Tiny:8
| [          Dismiss          ] -- button

The inventory subset can now be suppressed.  When shown (the default),
its size can be set independently of the map tiles' size.  I've set
the default to be 32x32 tiles instead of 16x16 used for the map.

The settings are saved and restored automatically by Qt, and persist
not just across save/restore cycles but into new games.  (That's not
a change, just a reminder.)

4 years agoremove duplicate line in .travis.yml
nhmall [Sat, 15 Aug 2020 20:52:19 +0000 (16:52 -0400)]
remove duplicate line in .travis.yml

4 years agoadjust travis-ci builds
nhmall [Sat, 15 Aug 2020 20:43:59 +0000 (16:43 -0400)]
adjust travis-ci builds

add builds that tests tty, curses, X11, and Qt5 on
all of the following:
linux-xenial, linux-bionic, linux-focal

Also still tests "nocommon" on earlier gcc versions.
Add a focal with gcc9 build to test that compiler version.

Here are the test builds:
linux-xenial-gcc-win-all
linux-bionic-gcc-win-all
linux-focal-clang-win-all
linux-xenial-gcc-nocommon
linux-focal-gcc9-win-all
linux-xenial-gcc-minimal
windows-visualstudio
windows-mingw
msdos-linux-focal-djgpp-crosscompile

4 years agomake sys/msdos/msdos-cross-compile.sh build msdos NetHack entirely
nhmall [Fri, 14 Aug 2020 22:23:31 +0000 (18:23 -0400)]
make sys/msdos/msdos-cross-compile.sh build msdos NetHack entirely

- should work on linux or MacOS to build an msdos zipfile distribution
- no longer requires env variables be set ahead of it because it will set some
  defaults within
- you must have zip and unzip on your system though
- you have to "make fetch-lua" first if you haven't already done that
- script takes care of obtaining the djgpp-cross-compiler etc, then
  uses it to build msdos NetHack
- to clean and rebuild from scratch:
  make -f sys/msdos/Makefile1.cross clean

4 years agomsdos cross-compile djggp build now with gcc 10
nhmall [Fri, 14 Aug 2020 21:25:05 +0000 (17:25 -0400)]
msdos cross-compile djggp build now with gcc 10

Also updates the travis build to Ubuntu focal because of an
ar libfl.so.2 shared library load error on xenial that was
easier to just get away from by moving to focal.

4 years ago'O' couldn't change 'symset'
PatR [Thu, 13 Aug 2020 22:24:24 +0000 (15:24 -0700)]
'O' couldn't change 'symset'

The revised options processing from however long ago broke using
'O' to change 'symset'.  ('roguesymset' worked ok.)  Picking it
in the main 'O' menu behaved as it nothing had been picked.  The
symset-specific submenu wasn't offered to the player because a
two-line block of code was omitted.

It seems amazing that no one has noticed in all this time.

4 years agoanother typo
nhmall [Thu, 13 Aug 2020 17:48:33 +0000 (13:48 -0400)]
another typo

4 years agowording bit
nhmall [Thu, 13 Aug 2020 17:42:40 +0000 (13:42 -0400)]
wording bit

4 years agominor typo bit in NewInstall.unx
nhmall [Thu, 13 Aug 2020 17:39:17 +0000 (13:39 -0400)]
minor typo bit in NewInstall.unx
missing closing bracket ')' and wording change

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Thu, 13 Aug 2020 16:24:07 +0000 (12:24 -0400)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Thu, 13 Aug 2020 17:35:37 +0000 (13:35 -0400)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agoupdate bottom of NewInstall.unx document with WANT_WIN_ build steps
nhmall [Thu, 13 Aug 2020 17:34:18 +0000 (13:34 -0400)]
update bottom of NewInstall.unx document with WANT_WIN_ build steps

4 years agocomment bit
nhmall [Thu, 13 Aug 2020 15:57:14 +0000 (11:57 -0400)]
comment bit
name had evolved but the comment had not been updated

4 years agomacosx.h Info.plist bit
nhmall [Thu, 13 Aug 2020 15:35:26 +0000 (11:35 -0400)]
macosx.h Info.plist bit

4 years agoupdate some hints mechanics for 2020
nhmall [Thu, 13 Aug 2020 15:34:23 +0000 (11:34 -0400)]
update some hints mechanics for 2020

Allow sharing of common code between different hints files
through use of: #-INCLUDE

new folder created: sys/unix/hints/include
new hints include files:
    sys/unix/hints/include/multiw-1.2020
    sys/unix/hints/include/multiw-2.2020

structure the early parts of sys/unix/hints/linux.2020 and
sys/unix/hints/macOS.2020 consistently, and utilize #-INCLUDE multiw-1.2020
and #-INCLUDE multiw-2.2020 in them. That will allow the Makefile lines
that they contain to be maintained in a single place.

4 years agomore Qt formatting
PatR [Thu, 13 Aug 2020 09:00:11 +0000 (02:00 -0700)]
more Qt formatting

4 years agominor Qt reformatting
PatR [Thu, 13 Aug 2020 08:45:06 +0000 (01:45 -0700)]
minor Qt reformatting

4 years agoQt header usage
PatR [Thu, 13 Aug 2020 00:01:03 +0000 (17:01 -0700)]
Qt header usage

Move the nine #undef's common to all qt_*.cpp sources into qt_pre.h.

Make "hack.h" usage consistent; always enclose withing 'extern "C {'
and '}' even though only some of the sources care.

4 years agotile2x11.h comment
PatR [Wed, 12 Aug 2020 23:15:28 +0000 (16:15 -0700)]
tile2x11.h comment

4 years agodisclosing inventory
PatR [Tue, 11 Aug 2020 21:55:43 +0000 (14:55 -0700)]
disclosing inventory

The end of game disclosure for inventory was passing want_reply==True
to the inventory display routine.  I don't know why because you can't
select anything.  This resulted in Qt disclosure showing inventory
with the [Ok] button disabled and blank boxes instead of object
glyphs beside the inv letters.  Changing to want_reply==False fixes
both aspects of that.

It has no apparent effect on tty or curses; on X11 (where [Ok] was
already enabled) it disables the [Search] button, a plus.  I don't
know whether it might mess up final disclosure for inventory on
WindowsGUI.  Or whether any interface which uses perm_invent window
for final inventory disclosure (if there are any) will be adversely
affected.

4 years agoanother linux.2020 tweak
nhmall [Tue, 11 Aug 2020 01:39:00 +0000 (21:39 -0400)]
another linux.2020 tweak
Leave CC alone; we've already determined whether it invoked gcc or clang

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Tue, 11 Aug 2020 01:28:59 +0000 (21:28 -0400)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agodetect the compiler available
nhmall [Tue, 11 Aug 2020 01:27:05 +0000 (21:27 -0400)]
detect the compiler available

test if CC invokes clang. If not, then assume it is gcc.

4 years agoQt info->annotate
PatR [Tue, 11 Aug 2020 01:11:12 +0000 (18:11 -0700)]
Qt info->annotate

The core is mapping #annotate to ^N, which has no effect when
number_pad is Off.  The Qt menu setup saw it as the way to run
that command, which will only work when number_pad is On.  This
fixes the menu and didn't break the large subset of other menu
commands I've tried, but I haven't gotten through half of them yet.

4 years agoQt menu tweak
PatR [Mon, 10 Aug 2020 23:39:30 +0000 (16:39 -0700)]
Qt menu tweak

An earlier tweak worked to prevent unnecessary line wrapping
for ^X output in a menu, but #enhance and '+' both had problems
with their last column.  This seems to work better but is still
based on thrashing about rather than knowledge of how things are
supposed to operate.

4 years agoQt paper doll inventory
PatR [Mon, 10 Aug 2020 22:25:56 +0000 (15:25 -0700)]
Qt paper doll inventory

In case you haven't seen it, the Qt screen layout is (a bigger
instance of):
+--------------------+------+--------------------------------+
| messages           |invent| status                         |
|                    |subset|                                |
|                    |      |                                |
|                    |      |                                |
+------------------------------------------------------------+
| map                                                        |
|                                                            |
 ...
|                                                            |
+------------------------------------------------------------+
where some status fields include an icon and the inventory subset is
a miniature map showing a paper doll-style display of object tiles
for worn and wielded items.  The two separating lines in the top half
can be dragged to resize the three windows there.  The default message
window width to too small to see full text of some messages but can
be scrolled left and right.  The window for the equipped subset of
inventory is unconditionally present; 'perm_invent' is a no-op.

Paper doll inventory layout (view with fixed-width font...):
Old         New         two-hand    dual-wield
  x H b       x H b       x H b       . H b
  S " w       S " w       W " W       X " w
  G C G       G C q       G C q       G C q
  = A =       = A =       = A =       = A =
  . U .       l U L       l U L       l U L
  . F .       . F .       . F .       . F .
Legend:
 '.' = blank, b = blindfold, '"' = amulet, '=' = left and right rings,
 w/W = primary weapon, x/X = alternate/secondary weapon, q = quiver,
 H = helmet, S = shield, G = gloves, C = cloak, A = suit, U = shirt,
 F = boots, l = leash, L = active light source (lamp/candle/Sunsword).
Slots which don't have something equipped are shown blank.

'q' was missing; 'G' used to be shown on both sides.  'l' and 'L' are
new; for either, it picks the first one in inventory that's in active
use.  The 'S' and 'x' slots vary depending upon weapon situation
since wearing a shield, wielding a two-handed weapon, and engaging in
two-weapon combat are all mutually exclusive.

4 years agoleash use vs perm_invent
PatR [Mon, 10 Aug 2020 20:20:24 +0000 (13:20 -0700)]
leash use vs perm_invent

Noticed while working on Qt's version of persistent inventory
window (paper doll-style display of equipment in use), leashing
or unleashing a pet wasn't updating persistent inventory.  Leash
descriptions format differently when in use so immediate update
is warranted.

4 years agoadd compiler detection so warnings adjusted appropriately
nhmall [Mon, 10 Aug 2020 15:13:16 +0000 (11:13 -0400)]
add compiler detection so warnings adjusted appropriately

4 years agoQt menu sanity
PatR [Mon, 10 Aug 2020 14:24:16 +0000 (07:24 -0700)]
Qt menu sanity

The Qt menu entries which were executing nethack's help command
(the '?' menu) were doing so because their command keystroke was
a meta-character and such characters are being converted to '?'
to indicate an error in conversion to Latin1 character set.  The
old Qt3 code didn't perform any such conversion.

This fix feels fragile because there are two different places
deciding how to disambiguate partial extended commands (the code
for Qt's '#' handling and a new routine in the core).  Qt menus
now send '#' and enough letters to satisfy '#' handling for any
command which uses M-c or has no regular keystroke nor M-c one.
(If it were to send the full extended command name, the letters
after the unambiguous prefix would be left in the input queue to
be processed as subsequent commands.)

There is a fundamental problem that this doesn't address:  if
the player uses BIND directives in the run-time config file, the
Qt menu bindings will break unless the BINDs are all done before
selecting windowtype.  Qt's menu bindings translate a click on
a menu entry into the keystroke used to invoke the corresponding
command, so using BIND to change that after the menus are set up
will result in the wrong commands being executed.

4 years agodistinguish compiler version before adding new -Wno option
nhmall [Mon, 10 Aug 2020 14:03:12 +0000 (10:03 -0400)]
distinguish compiler version before adding new -Wno option

4 years agoUse the same compiler for Lua as specified for NetHack
nhmall [Mon, 10 Aug 2020 03:54:15 +0000 (23:54 -0400)]
Use the same compiler for Lua as specified for NetHack

It tried to use gcc for Lua when no gcc was available and failed.

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Sun, 9 Aug 2020 23:24:07 +0000 (19:24 -0400)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agoadd -Wno-format-overflow to build under sys/unix/hints/linux.2020
nhmall [Mon, 10 Aug 2020 03:33:55 +0000 (23:33 -0400)]
add -Wno-format-overflow to build under sys/unix/hints/linux.2020

Without that:

botl.c: In function ‘status_hilite2str’:
botl.c:3236:24: warning: ‘/’ directive writing 1 byte into a region of size between 0 and 255 [-Wformat-overflow=]
 3236 |     Sprintf(buf, "%s/%s/%s", initblstats[hl->fld].fldname, behavebuf, clrbuf);
      |                        ^
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 3 or more bytes (assuming 513) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c: In function ‘status_hilite_linestr_gather_conditions’:
botl.c:3134:48: warning: ‘%s’ directive writing up to 255 bytes into a region of size 245 [-Wformat-overflow=]
 3134 |                 Sprintf(condbuf, "condition/%s/%s",
      |                                                ^~
 3135 |                         conditionbitmask2str(cond_maps[i].bm), clrbuf);
      |                                                                ~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 12 or more bytes (assuming 267) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c: In function ‘do_statusline2’:
botl.c:229:37: warning: ‘%s’ directive writing up to 127 bytes into a region of size between 0 and 254 [-Wformat-overflow=]
  229 |             Sprintf(newbot2, "%s %s %s %s %s", hlth, cond, dloc, expr, tmmv);
      |                                     ^~                     ~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 640 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c:227:37: warning: ‘%s’ directive writing up to 127 bytes into a region of size between 0 and 254 [-Wformat-overflow=]
  227 |             Sprintf(newbot2, "%s %s %s %s %s", dloc, hlth, cond, expr, tmmv);
      |                                     ^~                     ~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 640 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c:225:37: warning: ‘%s’ directive writing up to 127 bytes into a region of size between 0 and 254 [-Wformat-overflow=]
  225 |             Sprintf(newbot2, "%s %s %s %s %s", dloc, hlth, expr, cond, tmmv);
      |                                     ^~                     ~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 640 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c:219:33: warning: ‘%s’ directive writing up to 127 bytes into a region of size between 0 and 254 [-Wformat-overflow=]
  219 |         Sprintf(newbot2, "%s %s %s %s %s", dloc, hlth, expr, tmmv, cond);
      |                                 ^~                     ~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 640 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c: In function ‘status_hilite_menu_add’:
botl.c:3726:38: warning: ‘ or ’ directive writing 4 bytes into a region of size between 1 and 80 [-Wformat-overflow=]
 3726 |                     Sprintf(obuf, "%s or %s",
      |                                      ^~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 163 bytes into a destination of size 80
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmd.c: In function ‘extcmd_via_menu’:
cmd.c:668:44: warning: ‘%s’ directive writing up to 127 bytes into a region of size 110 [-Wformat-overflow=]
  668 |         Sprintf(prompt, "Extended Command: %s", cbuf);
      |                                            ^~   ~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from cmd.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 19 and 146 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmd.c: In function ‘paranoid_query’:
cmd.c:4488:30: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 113 and 128 [-Wformat-overflow=]
 4488 |             Sprintf(qbuf, "%s%s %s", promptprefix, pbuf, responsetype);
      |                              ^~                    ~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from cmd.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 10 and 282 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
do_name.c: In function ‘getpos_menu’:
do_name.c:612:37: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  612 |             Sprintf(fullbuf, "%s%s%s", firstmatch,
      |                                     ^
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from do_name.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 1 or more bytes (assuming 257) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
do_name.c: In function ‘getpos’:
do_name.c:205:31: warning: ‘%s’ directive writing up to 255 bytes into a region of size 249 [-Wformat-overflow=]
  205 |         Sprintf(sbuf, "Type a %s when you are at the right place.", kbuf);
      |                               ^~                                    ~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from do_name.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 41 and 296 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
do_name.c:205:31: warning: ‘%s’ directive writing up to 255 bytes into a region of size 249 [-Wformat-overflow=]
  205 |         Sprintf(sbuf, "Type a %s when you are at the right place.", kbuf);
      |                               ^~                                    ~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from do_name.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 41 and 296 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
do_wear.c: In function ‘armor_or_accessory_off’:
do_wear.c:1510:52: warning: ‘%s’ directive writing up to 127 bytes into a region of size 103 [-Wformat-overflow=]
 1510 |             Sprintf(why, " without taking off your %s first", what);
      |                                                    ^~         ~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from do_wear.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 32 and 159 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dungeon.c: In function ‘print_dungeon’:
dungeon.c:2156:27: warning: ‘%s’ directive writing up to 1407 bytes into a region of size 256 [-Wformat-overflow=]
 2156 |             Sprintf(buf, "%s: %s %d", dptr->dname, descr, dptr->depth_start);
      |                           ^~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 10 and 1427 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dungeon.c:2153:27: warning: ‘%s’ directive writing up to 1407 bytes into a region of size 256 [-Wformat-overflow=]
 2153 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |                           ^~
dungeon.c:2153:26: note: directive argument in the range [-21474836472147483646]
 2153 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |                          ^~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 10 or more bytes (assuming 1427) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dungeon.c: In function ‘print_mapseen’:
dungeon.c:3191:33: warning: ‘%s’ directive writing up to 255 bytes into a region of size 249 [-Wformat-overflow=]
 3191 |         Sprintf(outbuf, " (play %s to open or close drawbridge)", tmp);
      |                                 ^~                                ~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 37 and 292 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dungeon.c:3352:35: warning: ‘%s’ directive writing up to 255 bytes into a region of size 240 [-Wformat-overflow=]
 3352 |         Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf));
      |                                   ^~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 18 and 273 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dungeon.c:3403:40: warning: ‘%s’ directive writing up to 255 bytes into a region of size 242 [-Wformat-overflow=]
 3403 |                 Sprintf(buf, "%s%syou, %s%c", PREFIX, TAB, tmpbuf,
      |                                        ^~                  ~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 16 and 271 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c: In function ‘edibility_prompts’:
eat.c:2359:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2359 |         Sprintf(buf, "%s like %s could be tainted!  %s", foodsmell, it_or_they,
      |                         ^~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 27 and 536 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2385:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2385 |         Sprintf(buf, "%s like %s might be poisonous!  %s", foodsmell,
      |                         ^~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 29 and 538 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2394:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2394 |         Sprintf(buf, "%s like %s might have been poisoned.  %s", foodsmell,
      |                         ^~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 35 and 544 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2400:25: warning: ‘ unhealthy.  ’ directive writing 13 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2400 |         Sprintf(buf, "%s unhealthy.  %s", foodsmell, eat_it_anyway);
      |                         ^~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 14 and 396 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2407:25: warning: ‘ rather acidic.  ’ directive writing 17 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2407 |         Sprintf(buf, "%s rather acidic.  %s", foodsmell, eat_it_anyway);
      |                         ^~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 18 and 400 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2415:25: warning: ‘ disgusting to you right now...’ directive writing 31 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2415 |         Sprintf(buf, "%s disgusting to you right now.  %s", foodsmell,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 32 and 414 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2430:25: warning: ‘ foul and unfamiliar to you...’ directive writing 30 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2430 |         Sprintf(buf, "%s foul and unfamiliar to you.  %s", foodsmell,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 31 and 413 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2450:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2450 |         Sprintf(buf, "%s like %s could be tainted!  %s",
      |                         ^~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 27 and 536 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2441:25: warning: ‘ unfamiliar to you.  ’ directive writing 21 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2441 |         Sprintf(buf, "%s unfamiliar to you.  %s", foodsmell, eat_it_anyway);
      |                         ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 22 and 404 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2376:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2376 |         Sprintf(buf, "%s like %s could be rotten! %s",  foodsmell, it_or_they,
      |                         ^~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 25 and 534 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2367:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 2367 |         Sprintf(buf, "%s like %s could be something very dangerous!  %s",
      |                         ^~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 44 and 553 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
explode.c: In function ‘explode’:
explode.c:539:69: warning: ‘%s’ directive writing up to 255 bytes into a region of size 236 [-Wformat-overflow=]
  539 |                     Sprintf(g.killer.name, "caught %sself in %s own %s", uhim(),
      |                                                                     ^~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from explode.c:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 21 or more bytes (assuming 276) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hacklib.c: In function ‘yyyymmddhhmmss’:
hacklib.c:1089:28: warning: ‘%02d’ directive writing between 2 and 11 bytes into a region of size between 4 and 11 [-Wformat-overflow=]
 1089 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |                            ^~~~
hacklib.c:1089:22: note: directive argument in the range [-21474836472147483647]
 1089 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from hacklib.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 15 and 67 bytes into a destination of size 15
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c: In function ‘status_enlightenment’:
insight.c:1208:40: warning: ‘%s’ directive writing up to 255 bytes into a region of size 127 [-Wformat-overflow=]
 1208 |                         Sprintf(sfx, " %s", buf), buf[0] = '\0';
      |                                        ^~   ~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 2 and 257 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c: In function ‘list_vanquished’:
insight.c:2464:39: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
 2464 |                 Sprintf(buftoo, "%*s%s", pfx, "", buf);
      |                                       ^
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 1 and 261 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c: In function ‘background_enlightenment’:
insight.c:326:27: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 253 and 256 [-Wformat-overflow=]
  326 |         Sprintf(buf, "%s%s%s%s form", !final ? "currently " : "",
      |                           ^~
  327 |                 altphrasing ? just_an(anbuf, tmpbuf) : "in ",
  328 |                 tmpbuf, uasmon->mname);
      |                 ~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 6 or more bytes (assuming 264) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c:326:27: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 243 and 246 [-Wformat-overflow=]
  326 |         Sprintf(buf, "%s%s%s%s form", !final ? "currently " : "",
      |                           ^~
  327 |                 altphrasing ? just_an(anbuf, tmpbuf) : "in ",
  328 |                 tmpbuf, uasmon->mname);
      |                 ~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 16 or more bytes (assuming 274) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c:444:33: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 121 and 248 [-Wformat-overflow=]
  444 |         Sprintf(buf, "in %s, on %s", dgnbuf, tmpbuf);
      |                                 ^~           ~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 9 and 391 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c:423:48: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 223 and 233 [-Wformat-overflow=]
  423 |         Sprintf(buf, "in the endgame, on the %s%s",
      |                                                ^~
  424 |                 !strncmp(tmpbuf, "Plane", 5) ? "Elemental " : "", tmpbuf);
      |                                                                   ~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 24 and 289 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c: In function ‘enlightenment’:
insight.c:245:21: warning: ‘ the ’ directive writing 5 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
  245 |     Sprintf(buf, "%s the %s's attributes:", tmpbuf,
      |                     ^~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 20 or more bytes (assuming 275) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c: In function ‘hitmm’:
mhitm.c:591:37: warning: ‘ squeezes’ directive writing 9 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
  591 |                     Sprintf(buf, "%s squeezes", magr_name);
      |                                     ^~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 10 and 265 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c:578:33: warning: ‘ stings’ directive writing 7 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
  578 |                 Sprintf(buf, "%s stings", magr_name);
      |                                 ^~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 8 and 263 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c:584:33: warning: ‘ touches’ directive writing 8 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
  584 |                 Sprintf(buf, "%s touches", magr_name);
      |                                 ^~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 9 and 264 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c:581:33: warning: ‘ butts’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
  581 |                 Sprintf(buf, "%s butts", magr_name);
      |                                 ^~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 7 and 262 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c:575:33: warning: ‘ bites’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
  575 |                 Sprintf(buf, "%s bites", magr_name);
      |                                 ^~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 7 and 262 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c:597:37: warning: ‘ hits’ directive writing 5 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
  597 |                     Sprintf(buf, "%s hits", magr_name);
      |                                     ^~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 6 and 261 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
options.c: In function ‘option_help’:
options.c:8035:28: warning: ‘ - ’ directive writing 3 bytes into a region of size between 1 and 236 [-Wformat-overflow=]
 8035 |         Sprintf(buf, "%-20s - %s%c", buf2, allopt[i].descr,
      |                            ^~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from options.c:14:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 25 or more bytes (assuming 260) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pager.c: In function ‘do_screen_description’:
pager.c:1189:38: warning: ‘%s’ directive writing up to 255 bytes into a region of size 254 [-Wformat-overflow=]
 1187 |             *firstmatch = look_buf;
      |                           ~~~~~~~~
 1188 |             if (*(*firstmatch)) {
 1189 |                 Sprintf(temp_buf, " (%s)", *firstmatch);
      |                                      ^~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from pager.c:9:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 4 and 259 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pager.c:1195:44: warning: ‘%s’ directive writing up to 255 bytes into a region of size 248 [-Wformat-overflow=]
 1195 |                 Sprintf(temp_buf, " [seen: %s]", monbuf);
      |                                            ^~    ~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from pager.c:9:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 10 and 265 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
potion.c: In function ‘dodip’:
potion.c:1949:26: warning: ‘%s’ directive writing up to 127 bytes into a region of size 124 [-Wformat-overflow=]
 1949 |         Sprintf(qbuf, "%s%s into the %s?", Dip_,
      |                          ^~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from potion.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 16 or more bytes (assuming 143) into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
potion.c:1939:26: warning: ‘%s’ directive writing up to 127 bytes into a region of size 124 [-Wformat-overflow=]
 1939 |         Sprintf(qbuf, "%s%s into the fountain?", Dip_,
      |                          ^~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from potion.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 24 and 151 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
potion.c:1969:24: warning: ‘%s’ directive writing up to 127 bytes into a region of size 124 [-Wformat-overflow=]
 1969 |     Sprintf(qbuf, "dip %s into", flags.verbose ? obuf : shortestname);
      |                        ^~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from potion.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 10 and 137 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
potion.c: In function ‘potionhit’:
potion.c:1424:41: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
 1424 |             Sprintf(saddle_glows, "%s %s", buf, aobjnam(saddle, "glow"));
      |                                         ^
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from potion.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 2 or more bytes (assuming 257) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spell.c: In function ‘getspell’:
spell.c:706:47: warning: ‘%s’ directive writing up to 255 bytes into a region of size 109 [-Wformat-overflow=]
  706 |             Sprintf(qbuf, "Cast which spell? [%s *?]", lets);
      |                                               ^~       ~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from spell.c:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 24 and 279 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
topten.c: In function ‘outentry’:
topten.c:1060:32: warning: ‘%s’ directive writing up to 255 bytes into a region of size 240 [-Wformat-overflow=]
 1060 |         Sprintf(linebuf, "%15s %s", "", linebuf3);
      |                                ^~       ~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from topten.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 17 and 272 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
trap.c: In function ‘untrap’:
trap.c:4462:58: warning: ‘%s’ directive writing up to 255 bytes into a region of size 88 [-Wformat-overflow=]
 4462 |                         qbuf, "There %s and %s here.  %s %s?",
      |                                                          ^~
......
 4465 |                         (ttmp->ttyp == WEB) ? "Remove" : "Disarm", the_trap);
      |                                                                    ~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from trap.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 42 or more bytes (assuming 297) into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uhitm.c: In function ‘hmon_hitmon’:
uhitm.c:1316:47: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 244 and 251 [-Wformat-overflow=]
 1316 |                 Sprintf(silverobjbuf, "Your %s%s %s",
      |                                               ^~
 1317 |                         strstri(saved_oname, "silver") ? "" : "silver ",
 1318 |                         saved_oname, vtense(saved_oname, "sear"));
      |                         ~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from uhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 7 or more bytes (assuming 269) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
weapon.c: In function ‘enhance_weapon_skill’:
weapon.c:1271:47: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 249 and 253 [-Wformat-overflow=]
 1271 |                         Sprintf(buf, " %s%s\t[%s]", prefix, P_NAME(i),
      |                                               ^~
 1272 |                                 sklnambuf);
      |                                 ~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from weapon.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 5 or more bytes (assuming 264) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
weapon.c:1268:49: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 248 and 252 [-Wformat-overflow=]
 1268 |                         Sprintf(buf, " %s %-*s [%s]", prefix, longest,
      |                                                 ^~
 1269 |                                 P_NAME(i), sklnambuf);
      |                                            ~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from weapon.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 6 or more bytes (assuming 265) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
weapon.c:1263:46: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 250 and 254 [-Wformat-overflow=]
 1263 |                         Sprintf(buf, " %s%s\t%s\t%5d(%4d)", prefix, P_NAME(i),
      |                                              ^~
 1264 |                                 sklnambuf, P_ADVANCE(i),
      |                                 ~~~~~~~~~
weapon.c:1263:38: note: directive argument in the range [0, 65535]
 1263 |                         Sprintf(buf, " %s%s\t%s\t%5d(%4d)", prefix, P_NAME(i),
      |                                      ^~~~~~~~~~~~~~~~~~~~~
weapon.c:1263:38: note: directive argument in the range [-325120, 327680]
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from weapon.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 15 or more bytes (assuming 277) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
weapon.c:1259:47: warning: ‘%-12s’ directive writing between 12 and 255 bytes into a region of size between 250 and 254 [-Wformat-overflow=]
 1259 |                         Sprintf(buf, " %s%-*s %-12s %5d(%4d)", prefix,
      |                                               ^~~~~
 1260 |                                 longest, P_NAME(i), sklnambuf, P_ADVANCE(i),
      |                                                     ~~~~~~~~~
weapon.c:1259:38: note: directive argument in the range [0, 65535]
 1259 |                         Sprintf(buf, " %s%-*s %-12s %5d(%4d)", prefix,
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~
weapon.c:1259:38: note: directive argument in the range [-325120, 327680]
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from weapon.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 27 or more bytes (assuming 277) into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../win/curses/cursinit.c: In function ‘curses_choose_character’:
../win/curses/cursinit.c:454:26: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  454 |     sprintf(choice, "%s%c", tmpchoice, '\033');
      |                          ^
In file included from /usr/include/stdio.h:867,
                 from /usr/include/curses.h:192,
                 from ../win/curses/cursinit.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 2 and 129 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../win/X11/winX.c: In function ‘X11_init_nhwindows’:
../win/X11/winX.c:1509:12: warning: ignoring return value of ‘seteuid’, declared with attribute warn_unused_result [-Wunused-result]
 1509 |     (void) seteuid(getuid());
      |            ^~~~~~~~~~~~~~~~~
../win/X11/winX.c:1570:12: warning: ignoring return value of ‘seteuid’, declared with attribute warn_unused_result [-Wunused-result]
 1570 |     (void) seteuid(savuid);
      |            ^~~~~~~~~~~~~~~
../win/tty/wintty.c: In function ‘tty_player_selection’:
../win/tty/wintty.c:964:30: warning: ‘%s’ directive writing up to 127 bytes into a region of size between 95 and 126 [-Wformat-overflow=]
  964 |         Sprintf(pbuf, "%s, %s%s %s %s", g.plname, aligns[ALGN].adj, plbuf,
      |                              ^~                                     ~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from ../win/tty/wintty.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 5 or more bytes (assuming 163) into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
version.c: In function ‘early_version_info’:
version.c:263:24: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  263 |     Sprintf(buf2, "%s\n", buf);
      |                        ^
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from version.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 2 and 257 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
version.c:263:24: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  263 |     Sprintf(buf2, "%s\n", buf);
      |                        ^
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from version.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 2 and 257 bytes into a destination of size 256
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

4 years agoThis sys/unix/hints/linux.2020 file can support tty, curses, x11, and Qt in the same...
nhmall [Sun, 9 Aug 2020 23:02:50 +0000 (19:02 -0400)]
This sys/unix/hints/linux.2020 file can support tty, curses, x11, and Qt in the same binary, or
any subset of those.

- For x11 support, you'll need to obtain and install x11 development libraries.
    For example, on Ubuntu 20.04 (as of August 2020):
        sudo apt-get install libx11-dev
        sudo apt-get install libmotif-dev
        sudo apt-get install libxaw7-dev
        sudo apt install xfonts-utils
       (That last one is for bdftopcf and mkfontdir utils)

- For Qt support, you'll need to obtain and install Qt.
    For example, on Ubuntu 20.04 (as of August 2020):
        sudo apt-get install qtbase5-dev
        sudo apt-get install qtmultimedia5-dev

    Another odd note about Qt on Linux is that if you find you are getting
    the following error trying to run NetHack after you build it:
         "error while loading shared libraries: libQt5Core.so.5:
          cannot open shared object file: No such file or directory"
    you may have to fix that (one-time only) by the following command:
     sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

- For curses support, you may need to obtain and install the
    ncurses development libraries if they aren't already installed
    with your distribution. They seem to be there already with Ubuntu 20.04, but
    for example, if you needed to install ncurses:
        sudo apt-get install libncurses-dev

- tty support shouldn't require any prerequisite additional packages.
---
Assuming you have the prerequisite packages mentioned above, you can
specify, right on the make command line, which window ports (or interfaces)
to include in your build. Doing it via the make command line means that you
don't have to edit the Makefile.

The make command line example below will build one binary that has
support for tty, curses, x11, and Qt. You can select between them via
your .nethackrc file (OPTIONS=windowtype:curses, OPTIONS=windowtype:tty,
OPTIONS=windowtype:x11, or OPTIONS=windowtype:Qt).

  make WANT_WIN_QT=1 WANT_WIN_X11=1 WANT_WIN_CURSES=1 WANT_WIN_TTY=1 install

4 years agoQt menu fixes: mainly Quit
PatR [Sun, 9 Aug 2020 21:55:05 +0000 (14:55 -0700)]
Qt menu fixes:  mainly Quit

Changes affecting everybody (using Qt):  rename game->Save to
game->Save-and-exit and game->Quit to game->Quit-without-saving.

OSX-specific changes:  add separate nethack->Quit and change
game->Quit-without-saving to game->_Quit-without-saving to prevent
that from being hijacked for the nethack menu.  nethack->Quit menu
entry works.  Command+Q is a keyboard shortcut for it.  They bring
up a menu with choices of "Quit without saving" and "Cancel and
return to game".  It's not the same as the handler for the window
Close button, which used to offer "Save" or "Cancel" (with the
latter triggering an infinite loop) but now offers "Save and exit"
or "Quit without saving".  They don't share any code.  The
game->_Quit-without-saving entry doesn't work; it runs nethack's '?'
command like a bunch of other broken menu entries.  If it did work,
it would give nethack's "Really quit?" prompt and proceed from there.
The "Quit without saving" response for nethack->Quit confirmation
bypasses that and just quits.

Also OSX, add a second 'about' entry.  The first one is hijacked and
added to the nethack menu, the second is help->_About_Qt_NetHack_
and avoids hijacking.  Both nethack->About and help->_About_ bring
up the same dialog box showing version and assorted other info.

A lot of flailing about with for relatively small amount of progress.