PatR [Sun, 26 Jun 2022 19:22:09 +0000 (12:22 -0700)]
fix #K3627 - impossible placing long worm at <0,0>
When migrating, a long worm is removed from the map to take off the
tail, then its head is put back to be treated like other monsters.
If that occurred when being forced to re-migrate during failure to
arrive from a prior migration, it wouldn't have valid coordinates
and the place_monster attempt produced an impossible warning.
(Other types of monsters don't get removed and put back so didn't
trigger the problem.)
The routine to format a monster when the data is suspect mistakenly
thought it was dealing with a long worm tail because the monster
didn't match level.monsters[0][0], so the warning inaccurately
reported the problem as "placing long worm tail".
PatR [Sat, 25 Jun 2022 18:26:05 +0000 (11:26 -0700)]
partial vampire fix
From a followup comment to a reddit post: a vampire who has gained
levels loses them when reverting to base form. This fixes the case
where it grows into a vampire lord; change the base form from plain
vampire to lord when that happens.
It does not fix the case where shapechanging to fog or bat or wolf
and then back to base form yields a new vampire or vampire lord
instead of the one that built itself up. Mainly affects pet vampires
since wild oees don't tend to grow very much.
PatR [Sat, 25 Jun 2022 06:35:26 +0000 (23:35 -0700)]
streamline the tty perm_invent bounder box set up
For the tty perm_invent boundary box initialiation, instead of doing
one of many assignments that do glyph lookup, do one of many symbol
assignments and one glyph lookup. No change in observable behavior.
Also, use the main dungeon's walls for box rendering instead of
selecting ones for whatever branch the hero happens to be in at the
time perm_invent gets enabled.
nhmall [Sat, 25 Jun 2022 00:10:11 +0000 (20:10 -0400)]
fix perm_invent via 'O' border issue
> Start with default symbol set and with perm_invent Off.
> Use 'O' to change perm_invent to On. The inventory with
> boundary box lines will briefly appear, then immediately be
> redrawn without those lines.
nhmall [Fri, 24 Jun 2022 19:01:38 +0000 (15:01 -0400)]
move some parts of TTY_PERM_INVENT into core
This starts the tty perm_invent just in time later in the
startup rather than initializing it with the other
game windows.
This also splits the duties:
The core will inquire from the window port about how many
inventory slots it can fill.
The core will handle figuring out the inventory text and
inventory letters, and will do the traversing of internal
data structures like obj chains, and passing customization
options on to the window port.
The window port will look after placing each inventory slot's
text at an appropriate location on the screen.
This, in theory, makes the core-portion available for
window ports other than tty to use, though none currently do.
The decision of what goes in an inventory slot is all left up
to the core with the update_invent_slot interface.
Documentation updates will come later, not at this time.
nhmall [Fri, 24 Jun 2022 00:35:43 +0000 (20:35 -0400)]
refresh content between really long menu pages
For a long while, I've noticed that if the first page of corner menu is
quite long, and the second page is much shorter, the content obliterated
by the first page is left missing until the menu is fully dismissed.
This attempts to fix that missing content up.
===========================================================================
BEFORE THIS PATCH - menu Page 1
===========================================================================
Amulets
J - a circular amulet
------------ Weapons
|..........| ------- a - a +0 two-handed sword (weapon in hands)
|..........| |...... b - a +0 axe (alternate weapon; not wielded)
#...........| #....... w - 7 orcish arrows
#|{..........#######|...... G - a battle-axe
#------------ |...... P - 7 ya
### ------- Armor
## c - an uncursed +0 ring mail (being worn)
# E - a splint mail
# Comestibles
------# d - an uncursed food ration
|.....# f - 6 food rations
|....| h - 2 sprigs of wolfsbane
|....| i - a cream pie
|....-### k - 3 tripe rations
|.<..| ###### ############## Scrolls
|.d@..######################## r - a scroll labeled ETAOIN SHRDLU
------ #### u - a scroll labeled PHOL ENDE WODAN
#### z - a scroll labeled XIXAXA XOXAXA XUXAXA
Spellbooks
Wizard the Plunderer St: o - a tan spellbook
Dlvl:1 $:0 HP:16(16) Pw:2(2) AC:7 q - a wrinkled spellbook
v - a thin spellbook
---------------------------------- x - a plain spellbook
|a - +0 two-handed sword (weapon i y - a tan spellbook
|b - +0 axe (alternate weapon; not H - an indigo spellbook
|c - uncursed +0 ring mail (being W - a light blue spellbook
|d - uncursed food ration X - a velvet spellbook
|e - uncursed oil lamp Potions
|f - 6 food rations g - a brilliant blue potion
|g - brilliant blue potion j - a fizzy potion
|h - 2 sprigs of wolfsbane m - an effervescent potion
|i - cream pie B - 2 golden potions
|j - fizzy potion D - a dark green potion
|k - 3 tripe rations I - a bubbly potion
|l - moonstone ring Rings
|m - effervescent potion l - a moonstone ring
|n - tiger eye ring n - a tiger eye ring
|o - tan spellbook Y - a topaz ring
|p - tinning kit Wands
|q - wrinkled spellbook s - a crystal wand
|r - scroll labeled ETAOIN SHRDLU Tools
|s - crystal wand e - an uncursed oil lamp
|t - oil lamp p - a tinning kit
|u - scroll labeled PHOL ENDE WODA t - an oil lamp
|v - thin spellbook A - a stethoscope
|w - 7 orcish arrows C - a bugle
|x - plain spellbook F - an oil lamp
|y - tan spellbook Gems/Stones
|z - scroll labeled XIXAXA XOXAXA L - 4 blue gems
---------------------------------- (1 of 2)
===========================================================================
BEFORE THIS PATCH - menu Page 2
While the second page is displayed, there are gaping missing portions of
the map, status lines, and now the tty perm_invent window.
===========================================================================
V - a white gem
(2 of 2)
------------
|..........| -------
|..........| |......
#...........| #.......
#|{..........#######|......
#------------ |......
### -------
##
#
#
------#
|.....#
|....|
|....|
|....-###
|.<..| ###### ##############
|.d@..########################
------ ####
####
Wizard the Plunderer St:
Dlvl:1 $:0 HP:16(16) Pw:2(2) AC:7
===========================================================================
AFTER THIS PATCH - menu Page 2
The obliterated content of the map, status lines, and tty perm_invent
are refreshed prior to displaying menu Page 2.
===========================================================================
PatR [Thu, 23 Jun 2022 20:14:28 +0000 (13:14 -0700)]
skip update_inventory during character init
With a debugging pline() in place, I could see that tty perm_invent
was being redrawn for each item added to hero's initial inventory.
Avoid that. There is an update_inventory() call just prior to
entering moveloop() which handles all of starting invent as a unit.
PatR [Thu, 23 Jun 2022 20:03:32 +0000 (13:03 -0700)]
tty perm_invent: fix right-hand panel
Introducing 'maxslot' at the last second invalidated a ton of prior
testing. This should fix all the modes of tty perm_invent, including
the missing bottom boundary for TTYINV=4 (show in-use items only, an
approximation of Qt's "paper doll" and of the '*' command).
The boundary box characters are set using cmap_to_glyph(S_<wall_type>)
which in theory makes them change depending on which branch of the
dungeon the hero is in. That isn't noticeable since they aren't drawn
as tiles, but it doesn't seem right.
nhmall [Thu, 23 Jun 2022 18:01:35 +0000 (14:01 -0400)]
groundwork for an interface change
Add a new window-port interface function
perminvent_info *
update_invent_slot(winid window, int slot, perminvent_info *);
That should be nice and flexible and allow exchanges of useful
information between the core and the window port. Information
to be exchange can be easily modified in include/wintype.h as
things evolve.
Information useful to the core can be exchanged from the
window-port in struct to_core.
Information useful from the core to the window-port can be
passed in struct from_core.
I'm not going to update any docs until much later after things
are fully working and settled.
This also doesn't fix or have anything to do with existing
TTY_PERM_INVENT issues.
PatR [Thu, 23 Jun 2022 09:05:52 +0000 (02:05 -0700)]
experimental change for tty perm_invent
This checks for 'TTYINV' in the environment and if found, it uses that
as a number describing a bit mask for how to show the perm_invent.
0 = current behavior, a-zA-Z in two columns (I've started referring
to those as panels because "column" is already used a lot);
1 = "show gold" => $a-zA-Z# in two columns; requires 1 more line;
2 = "sparse" => list all letters a-z in the left panel and A-Z in
the right whether there is an item in the slot or not, so that
open slots will be obvious;
3 = 1|2, "sparse" with $a-zA-Z$ instead of just letters;
4 = "in use" => full lines instead of side-by-side panels, listing
only items with non-zero obj->owornmask; currently requires 17
lines instead of 28 (or 29 for show-gold): room for top border,
15 lines of worn/wielded items, and bottom border; normal usage
would be capped at 3 weapon slots, 7 armor slots, and 4 accessory
slots, but it is possible to have more items in use (simplest
case is to pick up the iron ball while punished).
The #4 case isn't displaying its bottom border correctly and I haven't
figured out why.
If this turns out to be useful, perm_invent can become a compound or
some new option for perminv mode could be added.
PatR [Wed, 22 Jun 2022 21:21:57 +0000 (14:21 -0700)]
tty perm_invent fixes
Modify the error message delivery when too-small so that it works for
both NETHACKOPTIONS or .nethackrc and for 'O'. "Early failure" isn't
very early; using pline() instead of raw_print() ends up writing to
the base window but also works normally when used for failed attempt
to set perm_invent with 'O'.
Fix the off by one error in height which required an extra line that
ended up going unused.
Fix an off by one error in the middle divider. Forcing the same item
from the left column to the right column, I was seeing
"f - an uncursed +0 pair of leather glove" ["s (being worn)" truncated]
"F - an uncursed +0 pair of leather gl"
After the fix I get
"f - an uncursed +0 pair of leather glov"
"F - an uncursed +0 pair of leather glo"
(When terminal width is even, the left side is one character wider
than the right.)
Split the invent window creation code out of tty_create_nhwwindow() to
new routine tty_create_invent(). I came across
if (r == 0 || (newwin->maxrow - 1)
in the process (note lack of 'r ==' in the second part). I'm not sure
what the initialization code is intended to accomplish but missing
that init for the bottom (boundary box) row didn't seem to be causing
any problem.
This forces the required size to be big enough to handle statuslines:3
regardless of what the setting for that is at the time the perm_invent
window is created. When the value is 2, there will be a blank line
between status and the boundary box of perm_invent. When it is 3, the
third line will use that line and the only separator will be the top
boundary box line. Toggling back and forth with 'O' works as expected.
nhmall [Wed, 22 Jun 2022 17:50:53 +0000 (13:50 -0400)]
optlist verbose follow-up
When the NHOPTP syntax was copied and pasted from cond_ a few lines
above, the opt_out/opt_in setting should have been changed to opt_out
to match the verbose boolean.
PatR [Tue, 21 Jun 2022 23:22:44 +0000 (16:22 -0700)]
more '&m'
For what a key does, when operating on 'm' which produces two lines
of output, append a command to the first line so that the combination
forms a complete sentence. Also, expand on the explanattion of what
is going on in dowhatdoes().
PatR [Tue, 21 Jun 2022 19:52:29 +0000 (12:52 -0700)]
tentative fix for #K3626 - segfault when swallowed
release_hold() checked for (Upolyd && sticks(g.youmonst.data)) before
checking for (u.uswallow) and it could set u.ustuck to Null while
u.uswallow remained set to 1. dmove_core() was accessing u.ustuck->mx
and u.ustuck->my after that, resulting in a crash.
This fixes that particular case but there might be others that also
assume sticky poly'd hero should be handled before swallowed hero.
Being swallowed/engulfed needs to be handled first.
PatR [Tue, 21 Jun 2022 16:56:59 +0000 (09:56 -0700)]
tty perm_invent options again
I'm not sure what happened but something that worked when I tested
yesterday wouldn't work today. Have 'O' was pass TRUE rather than
FALSE to tty_perm_invent_toggled() when perm_invent is set to 'on'.
And skip that code for .nethackrc or NETHACKOPTIONS because it was
segfaulting.
PatR [Tue, 21 Jun 2022 15:57:58 +0000 (08:57 -0700)]
fix [again] exploiting artifact name rejection
Reported by entrez: attempting to name certain undiscovered items
after an artifact could be used to tell whether the item being named
was the same type as the artifact, so trying to name a gray stone
the Heart of Ahriman would let you tell whether it was a luckstone.
That was fixed years ago to reject for any undiscovered gray stone
rather than only for luckstone; you'll get "your hand slips" and the
name would be smudged. But that fix allowed a loophole and could
still be exploited if the player used lowercase for the name: it
would get changed to mixed capitalization if the object was the
artifact's type or stay lowercase if it only matched by description.
This changes to the capitalized name even when the type isn't an
exact match, so attempting to name either a luckstone or a touchstone
"the heart of ahriman" will name it "The Aeart of Xhriman" with at
least one smudged letter to avoid the actual artifact name.
Unrelated change: when attempting to apply a new name to an existing
artifact, it now says "<Artifact> resists" rather than "The artifact
seems to resist" because there's no "seeming" about it.
PatR [Tue, 21 Jun 2022 08:08:07 +0000 (01:08 -0700)]
boolean options parsing bit
Boolean switches: add an omitted 'break', plus a few 'default' cases
that would matter if someone turned on the warning about a switch
statement with 'enum' index that doesn't have cases for all possible
values of that enum. I haven't made any attempt to be exhaustive
about those; these few were just right in the same place.
PatR [Mon, 20 Jun 2022 23:18:50 +0000 (16:18 -0700)]
tty perm_invent option handling
The code for toggling perm_invent when windowtype=="tty" was inserted
into the middle of several switch cases that share 'need_redraw' so
was getting executed for various other options such as 'use_inverse'
that precede it in the list of cases. It was also continuing on to
general feedback for boolean options, reporting "'perm_invent option
toggled on" even if it failed and the option stayed off.
Patric Mueller [Mon, 20 Jun 2022 16:07:24 +0000 (18:07 +0200)]
Enable TTY_PERM_INVENT
The permanent inventory will be automatically shown if the terminal size
allows.
But only output an error message if the player requested it via
perm_invent option.
nhmall [Mon, 20 Jun 2022 14:40:55 +0000 (10:40 -0400)]
experimental config option TTY_PERM_INVENT
Add a rudimentary experimental always-up inventory display
capability to tty when the perm_invent option is in effect.
It requires an additional 28 rows available on the terminal
underneath the bottom status line.
It hasn't been optimized for performance as of yet.
nhmall [Mon, 20 Jun 2022 01:02:50 +0000 (21:02 -0400)]
more Verbose
Make verbose a prefix compound option. verbose and !verbose
should still work just as the boolean option did.
verbose0, verbose1, verbose2, verbose3, verbose4 must be
given a decimal value in the config file to set the bits in
verbosity_suppressions[0] through verbosity_suppressions[4].
That can be used to suppress any messages represented by the
verbosity_values defined in include/hack.h.
This also adds a more verbose variation of prinv() where the
total count is included in the message (that particular more
verbose message can be suppressed with OPTIONS=verbose3:134217728).
PatR [Sun, 19 Jun 2022 23:55:39 +0000 (16:55 -0700)]
fix #2779 - Windows GUI pulldown help menu \
specifies duplicate accelerator keystrokes
Reported and diagnosed nine and half years ago but never fixed.
In the WinGUI-specific help menu (under the titlebar, not nethack's
'?' command), both "&Long description of the game" and "&Longer list
of game options" use &L as accelerator. Typing 'L' or 'l' highlights
one of the entries, then <enter> is needed to execute it or typing
another 'L' or 'l' unhighlights it and highlights the other. Other
accelerators in that menu execute their entries immediately, without
the need for <enter>.
Change the first one to "Long description of the &game" so that 'G'
or 'g' becomes its accelerator.
That menu is missing several things that have been added to the menu
for '?'. I put in placeholder comments for them but won't pursue
them further.
PatR [Sun, 19 Jun 2022 20:50:15 +0000 (13:50 -0700)]
\#wizkill feedback
If is mon not sensed or seen and you use #wizkill to kill it, report
"You kill an unseen mon." rather than just "You kill the mon." Also,
override hallucination when identifying the victim.
PatR [Sun, 19 Jun 2022 09:30:45 +0000 (02:30 -0700)]
debugpline() fix
Something which occurred to me when looking at the magic whistle code.
It's behavior can vary depending upon whether pline()/You()/&c has
been called and that is detected by checking whether pline() has reset
iflags.last_msg. Change the debugpline() mechanism to prevent it from
interfering with that.
nhmall [Sun, 19 Jun 2022 08:56:48 +0000 (04:56 -0400)]
silence three compile warnings
apply.c:495:22: warning: variable 'optr' set but not used [-Wunused-but-set-variable]
struct permonst *optr;
^
1 warning generated.
cmd.c:4577:26: warning: variable 'how' set but not used [-Wunused-but-set-variable]
const char *dothat, *how;
^
cmd.c:4578:29: warning: variable 'viawindow' set but not used [-Wunused-but-set-variable]
boolean prefixhandling, viawindow;
^
2 warnings generated.
nhmall [Sat, 18 Jun 2022 14:29:15 +0000 (10:29 -0400)]
Guidebook datestamping
Allow the hints file to apply a correct timestamp to
the Guidebooks prior to use.
Detect the NH_DATESUB in the Guidebook.mn or Guidebook.tex
files and replace the datestamping line that follows.
If git is available, it determines the hash of the last commit
applied to doc/Guidebook.mn, and then determines the date of
that commit. The interim Guidebook.dated.mn (or
Guidebook.dated.tex) gets the datestamp applied.
If git isn't available or doesn't correctly provide the hash
for doc/Guidebook.mn, it should just continue to use whatever
hard-coded date in the Guidebook.mn source file (it uses it
instead of the interim file).
PatR [Sat, 18 Jun 2022 00:59:05 +0000 (17:59 -0700)]
feedback for bad command prefix usage
The old code to supply a list of directions if a prefix was followed
by a non-direction didn't work as intended anymore. Add some more
precise feedback for gGF mis-use and comment out some code that never
gets executed.
A number_pad user can get a complaint about 'G' when using '5' followed
by a non-directional command. Too bad for them.
PatR [Fri, 17 Jun 2022 21:58:02 +0000 (14:58 -0700)]
magic whistle bandage
Reported by entrez: if magic whistle summoned a pet onto a trap, the
messages produced could be in the wrong sequence or contradictory.
The code was collecting counts and name-of-first for shift (was seen
before whistling, seen at different spot after), for appear (wasn't
seen before, now is), and for disappear (was seen before, now isn't)
before dealing with a trap at arrival location. The trap could issue
a message (including pet killed, pet sent away--teleport trap, hole,
&c--or pet changed shape--which occurred after its name/old shape was
saved for use when it was the only one in its category), and finally
the summary message was issued.
Change the code to handle arriving in a trap before the collection
into the three categories that provide feedback, and skip the latter
if any message was given during mintrap(). That handles the most
glaring anomalies like killed followed by shifted location or takes
on new shape followed by old shape shifted or appeared. But it no
longer gives specific shift/appear/disappear feedback for those cases.
Pets that don't land on traps or who land on ones that don't issue
any feedback aren't affected.
The accessibility aspect of this--message feedback in order to avoid
tedious screen reading of the map--will need to be satisfied by the
trap feedback unless/until someone comes up with a better solution.
One possibility is an option to allow player to have rloc() always
issue its vanish and appear messages. Right now it does so when magic
whistle hasn't been discovered yet, then avoids that hyper-verbosity
(if hero has multiple pets) once it has. Or the whistle code could
count the number of pets first, then behave as if such an option is in
effect when the count is small and only resort to the current summary
method if the count is larger than some threshold.
PatR [Fri, 17 Jun 2022 10:18:52 +0000 (03:18 -0700)]
documentation update
Incorporate the diff from entrez describing the travel_debug wizard
mode option and removing obsolete M prefix from the Guidebook. That
missed a reference to it in the description of '_'.
I put M back in case someone who has used it with earlier versions
tries to use it and gets a no-such-command complaint so goes looking
for it.
Also, make the mention of ^X at the end of the discussion of status
stand out a bit. The indentation of its paragraph made it line up
with the preceding text instead of making it be distinct from that.
The TeX changes are untested and given the amount of punctuation
characters used, it will be surprising if they all have been quoted
properly.
PatR [Thu, 16 Jun 2022 18:00:53 +0000 (11:00 -0700)]
ignoring features when checking version compat
The nomakedefs stuff for cross-compiling support broke the code to
treat enabling or disabling some optional features as not breaking
save and bones file compatibility. It was relying on a macro whose
definition was local to mdlib.c rather than propagated among files.
makedefs still constructs date.h with a value indicating the ignored
features but the actual compatability check doesn't use that anymore.
Toggling SCORE_ON_BOTL shouldn't have caused existing files to be
rejected but they were.
nhmall [Thu, 16 Jun 2022 02:22:15 +0000 (22:22 -0400)]
recent changes caused a compile issue with QT
On a machine with both homebrew and macports, the presence of
macports was causing the homebrew Qt settings to be overwritten
right after they were set. Check to see if QTDIR is already
defined before proceeding with QT macports.
nhmall [Wed, 15 Jun 2022 20:00:13 +0000 (16:00 -0400)]
some macports updates
if macports is detected:
- check for ncurses from macports
- adjust the library search path to include /opt/local/lib
- adjust the C compiler include search path to include /opt/local/include
via -I/opt/local/include.
- if libncursesw* is in /opt/local/lib, link with it.
Also, USEMACPORTS=1 will use macports if you have both homebrew and macports.
It isn't required, but the ordering in the Makefile will use homebrew first
otherwise.
PatR [Tue, 14 Jun 2022 22:48:45 +0000 (15:48 -0700)]
itemized billing vs persistent inventory, round II
Reported by entrez: buying an unpaid item using itemized billing used
to result in the price information for unpaid items disappearing when
they get shown by perm_invent. (Their status as unpaid didn't change;
persistent inventory just got redrawn without cost information.) The
fix for that didn't handle buying a used-up item. There's no invent
update for the gone-item item but there is one for moving gold out of
hero's inventory to add to shopkeeper's inventory. The vanishing
price phenomenon applied to that situation too.
I can't think of any situation where persistent inventory would want
to hide unpaid status and/or cost, so always prevent those from being
excluded during perm_invent update.
PatR [Mon, 13 Jun 2022 23:06:06 +0000 (16:06 -0700)]
simulated mouse click for #therecmdmenu
The #therecmdmenu command calls getdir() which issues an "in what
direction?" prompt. This allows you to answer with "_" instead of a
regular direction, then it will call getpos() to allow you to move
the cursor and type "," (or ";") to behave as if a left-click had
been done or type "." (or ":") to behave as right-click.
Ordinarily I would think of the 'normal' getpos() response of "."
as suitable for left-click, then one of the other getpos finishers
for right-click, but comma is left of period on a standard keyboard
and that seems useful for remembering which is used for which click.
Left clicking on a spot farther than one step away offers travel,
throw iff lined up, and also click-look as choices. If you right
click farther than one step away, it will only offer click-look.
The look choice for either left or right click isn't inhibited by
having the clicklook option set to False. After all, player is
explicitly choosing the menu entry to look at something.
New getdir.mouse can be bound to some other key than "_" and the
getpos.pick* responses could already be re-bound, but there's no
separate getdir.left/right that could be used to bind different keys
from those used for the four getpos responses.
PatR [Mon, 13 Jun 2022 21:44:20 +0000 (14:44 -0700)]
fix 'simplify streamlined act_on_act()'
Still more PR #777. Commit c4c6c3d73a broke #therecmdmenu travel,
throw, and far-look. It was restricting dx and dy unnecessarily
and that resulted in not specifying the correct location when the
destination was farther than one step away.
Testing those properly requires a mouse. I've implemented a way
to simulate a left or right click at getdir()'s prompt (only useful
for #therecmdmenu). That will be committed separately.
PatR [Mon, 13 Jun 2022 18:30:59 +0000 (11:30 -0700)]
simplify streamlined act_on_act()
More PR #777: there's no need for there_cmd_menu() to pass absolute
<x,y> instead of <dx,dy> for a couple of actions. Those actions can
reconstruct <x,y> by adding <dx,dy> to <u.ux,u.uy>.
PatR [Mon, 13 Jun 2022 11:41:31 +0000 (04:41 -0700)]
better feedback for '& m' and '? f m'
For the description of what a keystroke does, augment 'm' (or whatever
key has been bound to #reqmenu) to replace the default description
|m prefix: request menu or modify command (#reqmenu).
with
|m movement prefix: move without autopickup and without attacking
|m non-movement prefix: request menu or modify command (#reqmenu).
The text is delivered by pline so tty will issue --More-- between the
two lines.
PatR [Mon, 13 Jun 2022 10:13:11 +0000 (03:13 -0700)]
streamline act_on_act()
Refine the code from pull request #777 by changing act_on_act() to
take 3 arguments instead of 6. x,y and dx,dy are mutually exclusive
so it doesn't need both pairs provided that the caller is adjusted
to pass the ones appropriate for the action, and dir is easily
derived from dx,dy for the couple of cases that use it.
PatR [Sun, 12 Jun 2022 20:19:13 +0000 (13:19 -0700)]
noxious quest nemeses
Refine the code added by pull request #763 to check the quest nemesis
death message for reference to noxious fumes rather than having the
three relevant roles be hardcoded.
PatR [Sat, 11 Jun 2022 22:32:37 +0000 (15:32 -0700)]
fixes entry for pull request #770 - wizard splbook
Pull request from matteverett: for generating starting equipment,
mark a wizard as having received a level 1 spellbook when getting
guaranteed force bolt so that the random second spellbook can be
level 1, 2, or 3 as intended rather than unintentionally be forced
to be level 1.
PatR [Sat, 11 Jun 2022 22:13:30 +0000 (15:13 -0700)]
pull request #798 - fix typo in disclosure \
of vanquired monsters.
Pull request from janne-hmp: the test for how many spaces to insert
in front of "the <unique monster>" couldn't match prefix "the "
because it was specifying a length of 3 instead of the 4 required to
include the trailing space.
Despite that clear error, the code worked as intended because the
default value of 0 is the same as an explicit value of 0 it would
have gotten if it had matched "the ". So there is no change in the
resulting vanquished monsters display.
PatR [Sat, 11 Jun 2022 18:38:52 +0000 (11:38 -0700)]
monsters less likely to dig in Sokoban
Make monsters being created in Sokoban that are given a random
defensive item be less likely to receive a wand of digging. Should
result in fewer extra holes needing to be plugged.
Resurrected from an old stash entry. I have no recollection of why
I didn't consider it to be ready for prime time way back then.
nhmall [Sat, 11 Jun 2022 17:52:58 +0000 (13:52 -0400)]
g++-12 bits, mostly Qt5 related
I forced a test compile to -std=c++20 mostly to see what we would
be up against. There was only a small number of things and they
are corrected in this commit.
c++20 has some issues with comparisons and bit twiddling between
different enums.
The vendor-supplied Qt5 header files triggered some of those issues as
well, so the qt_pre.h and qt_post.h NetHack header files were adjusted
to make those new warnings go away. I have not tested Qt6 under the
new compiler and c++ version yet.
Because there are multiple pragmas in qt_pre.h now, the conditional
ifdef structure in there was modified a little to make maintenance
simpler and have a single pragma push at the top. The pragma pop
comes after the Qt vendor-supplied header files, and is done
in qt_post.h.
The display.h macro cmap_to_glyph() was used in
a Qt c++ file and triggered a series of warnings because of that.
Rather than write c++20-friendly versions of those macros, the
simple fix is to provide a function on the C side of things
to front the cmap_to_glyph() macro, so fn_cmap_to_glyph()
was added.
Also thrown into this commit, PatR picked up on the fact that for
yesterday's new warning in qt_menu.cpp, the compiler had correctly
picked up on the fact that the format range of the variable 'cash'
had been correctly upper-capped at 999999999L in the warning message
because of an assignment prior. He suggested that perhaps by also adding
if (cash < 0)
cash = 0;
the warning might be eliminated altogether.
After a test, that was proven to be correct, so yesterday's
more-kludgy change is reverted and replaced with that variable
variable restriction ahead of the snprintf().