]> granicus.if.org Git - nethack/log
nethack
3 years ago"new boulder" fix
PatR [Sun, 10 Oct 2021 19:39:27 +0000 (12:39 -0700)]
"new boulder" fix

The default value for obj->corpsenm is NON_PM which is -1, so the
default value of boulder->next_boulder was non-zero instead of 0
as expected.  Because of that, boulder object formatting by xname()
was yielding "next boulder" when plain "boulder" was intended.
Until the boulder or one in a pile above it got pushed, then it
was explicitly reset.

3 years agobetter boulder pushing feedback
PatR [Sat, 9 Oct 2021 17:54:47 +0000 (10:54 -0700)]
better boulder pushing feedback

When you push a pile of boulders, describe the second and remainder
as "the next boulder" rather than just "the boulder".  Matters most
when pushing into water or lava and you keep on pushing when the
first one or more sink into the pool or plug it, but also matters
for an ordinary push where the top-most one moves successfully and
then blocks the continuation attempt to push the second one.  It was
somewhat confusing when all the messages said "the boulder" whether
they were referring to the same boulder or different ones.

Multiple pushes on the same move has always been a bit odd, but this
doesn't change that, just the feedback it generates.

3 years agofix an expanded-glyphs regression
nhmall [Sat, 9 Oct 2021 15:34:37 +0000 (11:34 -0400)]
fix an expanded-glyphs regression

Restore behavior that was unintentionally overlooked during
the expansion of glyphs earlier this year.

3 years agosimpleonames() fix
PatR [Fri, 8 Oct 2021 20:53:21 +0000 (13:53 -0700)]
simpleonames() fix

Some code from about a month back changed xname() and doname() to
only use a single 'obuf[]'.  That was to make sure that perm_invent
update also used at most one obuf.  They use some slightly convoluted
code when they called other routines which returned an obuf because
only the most recently allocated one can be explicitly released for
re-use.  That works, so I did the same for simpleonames() and
thesimpleoname() and for some reason neglected the convolution for
simpleonames().

For the case where plural was needed, it needs two obufs and tried
to release the first, which is a no-op.  So if it was used in a loop
like display_pickinv() uses doname(), it could have cycled through
all the obufs and clobbered one a caller was expecting to remember.
I'm not aware of any instances of this being an actual problem, just
happened to notice that simpleonames() was different from other
similar routines.

3 years agofixes37.0 entry typo
PatR [Fri, 8 Oct 2021 20:24:54 +0000 (13:24 -0700)]
fixes37.0 entry typo

3 years agomore DEF_PAGER
PatR [Thu, 7 Oct 2021 17:09:44 +0000 (10:09 -0700)]
more DEF_PAGER

For Unix, add internal vs external pager choice to #version.
Others always use internal pagination so don't need to see that.

Also remove obsolete "command completion" option.  I don't know
when it became unconditional but that was long enough ago to be
absent from the git log and from second cvs log included in that.

And streamline the RNG seed stuff a bit.

3 years agofix confused remove curse bug
PatR [Wed, 6 Oct 2021 20:46:27 +0000 (13:46 -0700)]
fix confused remove curse bug

Reported directly to devteam, player observed that objects on the
floor had their bless/curse state change when reading a blessed
scroll of remove curse while confused.  Message feedback mentioned
a silver saber being dropped.  I didn't attempt to view the ttyrec
playbacks; what I'm sure happened was that the saber was secondary
weapon for dual wielding and had been uncursed; the confused remove
curse effect cursed it, which in turn caused it to be dropped.  The
saber's 'next object' pointer became the [previous] top of the pile
at that spot and further object traversal intended to process the
rest of hero's inventory ended up processing floor objects there
instead.

This bug has been present for over 20 years (since 3.3.0 came out
in late 1999, when dual wielding was introduced and cursing of the
secondary weapon forced it to be dropped since making it become
welded was deemed to be too complicated) and never been reported.
Most likely players keep secondary weapons blessed so the scroll
effect doesn't touch them and simple object traversal sticks with
inventory.  Or items at the spot have unknown BUC state so having
them be affected wouldn't be particularly noticeable.

3 years agounused variable: g.restoring
PatR [Tue, 5 Oct 2021 08:57:27 +0000 (01:57 -0700)]
unused variable: g.restoring

Get rid of the last reference to 'g.restoring' (which managed to
unintentionally survive the change to 'g.program_state.restoring').

Also have suppress_map_output() check 'g.program_state.saving' and
switch the couple of checks against that flag to use the function.

3 years agofix Unix build with DEF_PAGER defined
PatR [Tue, 5 Oct 2021 08:11:24 +0000 (01:11 -0700)]
fix Unix build with DEF_PAGER defined

Eliminate a couple of compile warnings produced when DEF_PAGER is
defined:  unixmain.c: g.catmore=DEF_PAGER; wintty.c: fd=open(...).

Override its use when DLB is also defined since an external pager
could access 'license' but not 'history', 'opthelp', &c when those
are in the dlb container file.

In the commented out value for DEF_PAGER, show a viable value for
the default configuration these days.

3 years agohints/macOS.2020 - remote duplicate -DDLB
PatR [Tue, 5 Oct 2021 02:43:04 +0000 (19:43 -0700)]
hints/macOS.2020 - remote duplicate -DDLB

3 years agodisplacer monster vs long worm
PatR [Sun, 3 Oct 2021 21:15:02 +0000 (14:15 -0700)]
displacer monster vs long worm

Reported directly to devteam:  monster vs monster location swapping
didn't handle single-segment long worms properly.  Multi-segment
worms are disallowed but a worm with no visible segments (which
actually has 1 segment at the head's location) are allowed and the
segment wasn't being moved with the core monster and could trigger
warnings if sanity checking is enabled.  The next time that the
worm moved, it got itself back in synch.

I couldn't reproduce the warning but mdisplacem() clearly assumed
that a long worm reporting 0 segments didn't have any so wasn't
attempting to handle the hidden one.

3 years agocomment bit needed updating for a while
nhmall [Sun, 3 Oct 2021 13:42:32 +0000 (09:42 -0400)]
comment bit needed updating for a while

3 years agofix github issue #596 - wishing exploit
PatR [Thu, 30 Sep 2021 20:08:27 +0000 (13:08 -0700)]
fix github issue #596 - wishing exploit

for helm of opposite alignment.

Discovered and described by vultur-cadens.

The #adjust command can be used to split an object stack and if the
shop price of the two halves are different, the new stack will have
its obj->o_id modified to make the prices the same.  That could be
used to tip off the player as to what the low bits of the next o_id
will be.  Since no time passes, no intervening activity such as
random creation of a new monster can take place, so the player could
wish for something that depends on o_id with some degree of control.
Matters mainly for helms of opposite alignment intended to be used
by neutral characters since the player isn't supposed to be able to
control that.  (Other items like T-shirt slogan text and candy bar
wrapper text had a similar issue but controlling those wouldn't have
had any tangible difference on play.)

The issue writeup suggested allowing the player to specify a helm's
alignment during a wish.  That would defeat the purpose of having
o_id affect the helm's behavior in an arbitrary but repeatable way
so is rejected.

I implemented this fix before seeing a followup comment that suggests
using a more sophisticated decision than 'obj->o_id % N' for the
arbitrary effect.  This just increments context.ident for the next
obj->o_id or mon->m_id by 1 or 2 instead of always by 1 and should
be adequate.  It also has the side-effect that two consecutive wishes
for helm of opposite alignment won't necessary give one for each of
the two possible 'polarities', even with no intervening activity by
monsters, reinforcing the lack of player control.

Minor bonus fix:  it moves the incrementing check for wrap-to-0 into
a single place instead of replicating that half a dozen times.  Ones
that should have been there for shop billing and for objects loaded
from bones files were missing.

Fixes #596

3 years agomore fixes entry tinkering for consistency
nhmall [Thu, 30 Sep 2021 18:32:25 +0000 (14:32 -0400)]
more fixes entry tinkering for consistency

3 years agocorrect a fixes37.0 entry
nhmall [Thu, 30 Sep 2021 18:26:10 +0000 (14:26 -0400)]
correct a fixes37.0 entry

3 years agofix github issue #594 - special attacks
PatR [Thu, 30 Sep 2021 12:26:04 +0000 (05:26 -0700)]
fix github issue #594 - special attacks

by the Riders that only damage the hero, not other monsters.

Noticed and diagnosed by vultur-cadens.  Attacks dishing out the
damage type AD_DETH (Death), AD_FAMN (Famine), AD_PEST (Pestilence),
and also AD_DISE (Demogorgon, Juiblex, Scorpius) did 0 damage if
inflicted against monsters.  That made Death harmless to other
monsters.  The others have additional attacks (in the two Rider's
cases, only if both instances of their special attack hit on the
same move so that the second one is converted into a stun attack)
and could manage to kill other monsters.

The uhitm case can't happen.  I suspect that the mhitm case was
originally intentionally omitted as something which won't happen,
but that's just a guess.

Fixes #594

3 years agobmp file Y dimension
nhmall [Tue, 28 Sep 2021 16:21:49 +0000 (12:21 -0400)]
bmp file Y dimension

3 years agoGuidebook make sequencing
PatR [Mon, 27 Sep 2021 08:30:53 +0000 (01:30 -0700)]
Guidebook make sequencing

Be able to run 'make Guidebook{|.txt|.ps}' in the doc subdirectory
without requring a full install first.

makedefs is no longer one of the first things built when building
nethack, and even if it was, nobody should have to rebuild all of
nethack after 'make spotless' when they just want to create one
or more of the formatted Guidebooks.  The 'roff versions (.ps and
also .txt) use makedefs as a filter by default, so wouldn't build
if it wasn't there.

Have Makefile.doc build makedefs when needed.

Clean up some dependencies in Makefile.utl.

Add a couple of comments to Makefile.src.

3 years agomissed a couple
nhmall [Sun, 26 Sep 2021 20:12:50 +0000 (16:12 -0400)]
missed a couple

3 years agoother.txt updates
nhmall [Sun, 26 Sep 2021 19:59:26 +0000 (15:59 -0400)]
other.txt updates

altar tile differentiation
- contributed by Michael Meyer

3 years agoupdate fixes37.0 and doc/Guidebook.txt
nhmall [Sun, 26 Sep 2021 19:48:59 +0000 (15:48 -0400)]
update fixes37.0 and doc/Guidebook.txt

make format of pull request entries consistent

3 years agoThis is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt
nhw_cron [Sun, 26 Sep 2021 13:24:07 +0000 (09:24 -0400)]
This is cron-daily v1-Jan-20-2020.  guidebook updated: doc/Guidebook.txt

3 years agoMerge branch 'several-pr' into NetHack-3.7
nhmall [Sun, 26 Sep 2021 12:59:41 +0000 (08:59 -0400)]
Merge branch 'several-pr' into NetHack-3.7

3 years agoMerge branch 'supply-missing-changes' of https://github.com/argrath/NetHack into...
nhmall [Sun, 26 Sep 2021 12:56:30 +0000 (08:56 -0400)]
Merge branch 'supply-missing-changes' of https://github.com/argrath/NetHack into several-pr

3 years agoMerge branch 'delete-extra-lines' of https://github.com/argrath/NetHack into several-pr
nhmall [Sun, 26 Sep 2021 12:56:08 +0000 (08:56 -0400)]
Merge branch 'delete-extra-lines' of https://github.com/argrath/NetHack into several-pr

3 years agoMerge branch 'ice-running' of https://github.com/copperwater/NetHack into several-pr
nhmall [Sun, 26 Sep 2021 12:54:47 +0000 (08:54 -0400)]
Merge branch 'ice-running' of https://github.com/copperwater/NetHack into several-pr

3 years agoMerge branch 'fix-travel' of https://github.com/entrez/NetHack into several-pr
nhmall [Sun, 26 Sep 2021 12:54:10 +0000 (08:54 -0400)]
Merge branch 'fix-travel' of https://github.com/entrez/NetHack into several-pr

3 years agoFix compilation with TTY_TILES_ESCCODES for expanded-glyphs
Patric Mueller [Sat, 25 Sep 2021 22:02:58 +0000 (00:02 +0200)]
Fix compilation with TTY_TILES_ESCCODES for expanded-glyphs

3 years agoSupply missing changes
SHIRAKATA Kentaro [Thu, 23 Sep 2021 05:29:33 +0000 (14:29 +0900)]
Supply missing changes

Some changes applied to Guidebook.mn were not applied to Guidebook.tex.
This commit supplies them.

3 years agorecalc_mapseen vs rooms
PatR [Fri, 24 Sep 2021 19:01:54 +0000 (12:01 -0700)]
recalc_mapseen vs rooms

Reported and diagnosed by entrez:
recalc_mapseen() has been looking at all slots in u.urooms[] rather
than stopping at the first \0.  Since the whole array doesn't get
zeroed out when the value changes, stale room indices might follow
that first \0 and any rooms those referred to would erroneously get
flagged as having been visited by overview updates.  Wouldn't matter
for the level where the stale indices got set, since you'd have to
have been in those rooms for it to happen, but would matter once you
moved on to other levels.

3 years agomove enums in display.h ahead of macro definitions
nhmall [Thu, 23 Sep 2021 01:46:30 +0000 (21:46 -0400)]
move enums in display.h ahead of macro definitions

move up the enums in display.h so that the enum values can be used
in place of mysterious magic numbers in some of the macro
definitions.

3 years agoremove unneeded per level flag
nhmall [Thu, 23 Sep 2021 01:17:21 +0000 (21:17 -0400)]
remove unneeded per level flag

this is now taken care of in back_to_glyph (via altar_to_glyph)

3 years agowarning fix
PatR [Wed, 22 Sep 2021 21:09:46 +0000 (14:09 -0700)]
warning fix

3 years agoyet more expanded-glyphs altar follow-up
nhmall [Wed, 22 Sep 2021 19:47:17 +0000 (15:47 -0400)]
yet more expanded-glyphs altar follow-up

The 5 glyphs are now unaligned_altar, chaotic_altar, neutral_altar,
lawful_altar, and high_altar. The latter is only mapped if you are
on astral or sanctum levels.

3 years agodelete extra lines
SHIRAKATA Kentaro [Wed, 22 Sep 2021 18:30:57 +0000 (03:30 +0900)]
delete extra lines

3 years agomore expanded-glyphs follow-up
nhmall [Wed, 22 Sep 2021 18:20:41 +0000 (14:20 -0400)]
more expanded-glyphs follow-up

relocate reset_glyphmap() call to more appropriate location
valley and mines unaligned altars are included in the level-specfic
colorization

3 years agoanother expanded-glyphs follow-up for altars
nhmall [Wed, 22 Sep 2021 16:58:06 +0000 (12:58 -0400)]
another expanded-glyphs follow-up for altars

3 years agoexpanded-glyphs follow-up: altars
nhmall [Wed, 22 Sep 2021 16:01:21 +0000 (12:01 -0400)]
expanded-glyphs follow-up: altars

3 years agosilence compiler warning in droppables()
PatR [Wed, 22 Sep 2021 14:59:36 +0000 (07:59 -0700)]
silence compiler warning in droppables()

Reported by entrez as a github issue for evilhack, 'gcc -2' issued
warnings about droppables() possibly returning the address of a local
variable (&dummy).  It is mistaken; that never gets returned because
of various checks being performed.  But making 'dummy' be static adds
negligible cost and should shut it up (not verified but no doubt
about viability...).

3 years agofix build when TEXTCOLOR is not defined
nhmall [Tue, 21 Sep 2021 12:38:56 +0000 (08:38 -0400)]
fix build when TEXTCOLOR is not defined

This was picked-up by the CI minimal build which #undefine's
several things before attempting the build.

3 years agoformatting bit: display_self()
PatR [Tue, 21 Sep 2021 08:02:52 +0000 (01:02 -0700)]
formatting bit: display_self()

3 years agoWindows Makefile.gcc update
nhmall [Tue, 21 Sep 2021 07:40:17 +0000 (03:40 -0400)]
Windows Makefile.gcc update

tilemap needs to link with tilemap.o monst.o objects.o drawing.o

3 years agobump editlevel
nhmall [Tue, 21 Sep 2021 01:19:39 +0000 (21:19 -0400)]
bump editlevel

3 years agoadd fixes37.0 entries for the expanded-glyphs
nhmall [Mon, 20 Sep 2021 14:15:05 +0000 (10:15 -0400)]
add fixes37.0 entries for the expanded-glyphs

3 years agotrailing whitespace
nhmall [Mon, 20 Sep 2021 13:32:40 +0000 (09:32 -0400)]
trailing whitespace

3 years agobuild warning
nhmall [Sun, 19 Sep 2021 19:15:11 +0000 (15:15 -0400)]
build warning

sp_lev.c: In function â€˜lspo_altar’:
sp_lev.c:3962:9: warning: declaration of â€˜shrine’ shadows a global
declaration [-Wshadow]
 3962 |     int shrine;
       |         ^~~~~~
       In file included from ../include/hack.h:217,
                        from sp_lev.c:14:
../include/display.h:959:5: note: shadowed
declaration is here
  959 |     shrine
        |     ^~~~~~

3 years agoMerge branch 'NetHack-3.7' into expanded-glyphs
nhmall [Sun, 19 Sep 2021 18:45:02 +0000 (14:45 -0400)]
Merge branch 'NetHack-3.7' into expanded-glyphs

3 years agoBones piles can be ransacked by adjacent monsters
Pasi Kallinen [Sun, 19 Sep 2021 18:20:13 +0000 (21:20 +0300)]
Bones piles can be ransacked by adjacent monsters

If a bones file is created, any object-liking monster next to
where hero died has a chance of grabbing objects from hero's
inventory.

This comes from xNetHack by copperwater <aosdict@gmail.com>.

3 years agoIzchak occasionally stocks wands/scrolls/spellbooks of light
Pasi Kallinen [Sun, 19 Sep 2021 17:52:01 +0000 (20:52 +0300)]
Izchak occasionally stocks wands/scrolls/spellbooks of light

This comes from xNetHack by copperwater <aosdict@gmail.com>

3 years agoGas clouds expand around terrain rather than being rhomboid
Pasi Kallinen [Sun, 19 Sep 2021 10:51:51 +0000 (13:51 +0300)]
Gas clouds expand around terrain rather than being rhomboid

The gas will expand from its chosen center point via breadth-first
search instead of hardcoding a diagonal shape. The search is performed
with a randomized list of directions, and has 50% chance of not spreading
to a space it otherwise would have spread to. This has the effect of fuzzing
the cloud edges in open areas, helping the clouds on, for instance,
the Plane of Fire not be big rhombuses.

Also some other code refactoring related to stinking clouds in read.c

This comes from xNetHack by copperwater <aosdict@gmail.com>

3 years agoexpand the glyphs
nhmall [Sat, 18 Sep 2021 23:44:38 +0000 (19:44 -0400)]
expand the glyphs

The walls for the mines, gehennom, knox, and sokoban had been
changed at the "tile"-level, with no awareness of the core game,
or non-tile interfaces.
- Expand the glyphs to include a set of walls for the main level
as well as each of those mentioned above.

Altars had been adjusted at the map_glyphinfo() level to substitute
some color variations on-the-fly for unaligned, chaotic, neutral,
lawful altars, and shrines. The tile interface had no awareness of
the feature.
- Expand the glyphs to include each of the altar variations that
had been implemented in the display code for tty-only. This required
the addition of four placeholder tiles in other.txt. Someone with
artistic skill will hopefully alter the additional tiles to better
reflect their intended purpose.

Explosions had unique tiles in the tile window port, and the display
code for tty tinkered with the colors, but the game had very little
awareness of the different types of explosions.
- Expand the glyphs to include each of the explosion types: dark,
noxious, muddy, wet, magical, fiery and frosty.

Pile-markers to represent a pile had been introduced at the
display-level, without little to no awareness by the core game.
- Expand the glyphs to include piletops, including objects,
bodys, and statues.

Recently male and female variations of tiles and monsters had been
had been introduced, but the mechanics had been mostly done at the
display-level through a marker flag. The window port interface then
had to increment the tile mapped to the glyph to get the female version
of the tile.
- Expand the glyphs to include the male and female versions of the
monsters, and their corresponding pet versions, ridden, detected
versions and statues of them.

Direct references to GLYPH_BODY_OFF and GLYPH_STATUE_OFF
in object_from_map() in pager.c were getting incomplete results.
- Add macros glyph_to_body_corpsenm(glyph) and
glyph_to_statue_corpsenm(glyph) macros for obtaining the corpsenm
value after passing the glyph_is_body() or glyph_is_statue() test.

Other relevant notes:

- The tile ordering in the win/share/*.txt tile files has been altered,
other.txt in particular.

- tilemap.c has had a lot of alterations to accommodate the expanded
glyphs. Output that is useful for troubleshooting will end up in
tilemappings.lst if OBTAIN_TILEMAP is defined during build.
It lists all of the glyphs and which tile it gets mapped to, and also
lists each tile and some of the references to it by various glyphs.

- An array glyphmap[MAXGLYPH] is now used. It has an entry for each
glyph, ordered by glyph, and once reset_glyphs(glyph) has been run, it
contains the mapped symindex, default color, glyphflags, and tile
index.
If USE_TILES is defined during build, the tile.c produced from the
tilemap utility populates the tileidx field of each array element with
a glyph-to-tile mapping for the glyph. Later on, when reset_glyphmap()
is run, the other fields of each element will get populated.

- The glyph-to-tile mapping is an added field available to a window
port via the glyphinfo struct passed in the documented interface. The
old glyph2tile[] array is gone. The various active window ports that
had been using glyph2tile[] have been updated to use the new interface
mechanism. Disclaimer: There may be some bug fixing or tidying
required in the window port code.

- reset_glyphmap() is called after config file options parsing
has finished, because some config file settings can impact the results
produced by reset_glyphmap().

- Everything that passes the glyph_is_cmap(glyph) test must
return a valid cmap value from glyph_to_cmap(glyph).

- An 'extern glyph_info glyphmap[MAX_GLYPH];' is inserted into the
top of only the files which need awareness of it, not inserted into
display.h. Presently, the only files that actually need to directly
reference the glyphmap[] array are display.c, o_init.c (for shuffling
the tiles), and the generated tile.c (if USE_TILES is defined).

- Added an MG_MALE glyphflag to complement the MG_FEMALE glyphflag.

- Provide an array for wall colorizations. reset_glyphmap() will draw
the colors from this array: int array wallcolors[sokoban_walls + 1];
The indices of the wallcolors array are main_walls (0), mines_walls
(1), gehennom_walls (2), knox_walls (3), and sokoban_walls (4).
In future, a config file option for adjusting the wall colors and/or
an 'O' option menu to do the same could be added. Right now, the
initializaton of the wallcolors[] array entries in display.c leaves the
walls at CLR_GRAY, matching the defsym color.

- Most of the display-level kludges for some of the on-the-fly
interface features have been removed from map_glyphinfo() as they
aren't needed any longer. These glyph expansions adhere more closely to
the original glyph mechanics of the game.

- Because the glyphs are re-ordered and expanded, an update to
editlevel will be required upon merge of these changes.

3 years agoWalking near buried zombifying corpses wakes them up
Pasi Kallinen [Sat, 18 Sep 2021 18:24:48 +0000 (21:24 +0300)]
Walking near buried zombifying corpses wakes them up

Moving without stealth will reduce the zombifying timeout
of buried corpses under and around hero's location.

3 years agoMove Pw regen into separate routine
Pasi Kallinen [Sat, 18 Sep 2021 17:23:20 +0000 (20:23 +0300)]
Move Pw regen into separate routine

3 years agoThis is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt
nhw_cron [Sat, 18 Sep 2021 14:24:07 +0000 (10:24 -0400)]
This is cron-daily v1-Jan-20-2020.  guidebook updated: doc/Guidebook.txt

3 years agorename explosion symbols
nhmall [Sat, 18 Sep 2021 14:04:25 +0000 (10:04 -0400)]
rename explosion symbols

Use a slightly more meaningful name for each one rather than
a sequential numerical name.

S_explode1 to S_expl_tl
S_explode2 to S_expl_tc
S_explode3 to S_expl_tr
S_explode4 to S_expl_ml
S_explode5 to S_expl_mc
S_explode6 to S_expl_mr
S_explode7 to S_expl_bl
S_explode8 to S_expl_bc
S_explode9 to S_expl_br

3 years agoGuidebook.tex update from cron daily
nhmall [Sat, 18 Sep 2021 11:32:25 +0000 (07:32 -0400)]
Guidebook.tex update from cron daily

3 years agofix error in Guidebook.tex and Guidebook date bump
nhmall [Sat, 18 Sep 2021 02:44:16 +0000 (22:44 -0400)]
fix error in Guidebook.tex and Guidebook date bump

3 years agobuild warning compiling with visual studio 2019
nhmall [Sat, 18 Sep 2021 02:32:06 +0000 (22:32 -0400)]
build warning compiling with visual studio 2019

3 years agoAllow dropping just picked up items
Pasi Kallinen [Fri, 17 Sep 2021 17:52:54 +0000 (20:52 +0300)]
Allow dropping just picked up items

When using a menu to drop or put in items into a container,
allow putting in the item (or items) you picked up previously,
by selecting the 'P' entry from the item class menu

Inspired by the itemcat patch by Stanislav Traykov.

Invalidates saves and bones.

3 years agofix odd messages caused by buffer re-use
PatR [Thu, 16 Sep 2021 03:56:06 +0000 (20:56 -0700)]
fix odd messages caused by buffer re-use

Reported and diagnosed by entrez:
"The <mon> yanks <two-handed weapon> from your corpses!"

It became unwielded and that triggered a perm_invent update and
such updates reformat entire inventory, so if that contains a dozen
or more items it will use all the obuf[] static buffers as least
once.  In this case, the bullwhip code had plural of "hand" in one
of those buffers and by the time it delivered the message which
used that, the value had been clobbered.

As the diagnosis mentioned, it can be tricky to reproduce since
either &obuf[0] or &obuf[PREFIX] might be used and if the value
being clobbered didn't overlap, the effect wasn't noticeable.

Instead of fixing the bullwhip message, this changes inventory
display so that it should no longer churn through all the buffers.

It also adds a fixes entry for #K3401, which was already fixed for
3.7 but I hadn't been able to reproduce it for 3.6.x (which I now
blame on the PREFIX trickiness).

3 years agoWindows Makefile.msc updates
nhmall [Thu, 16 Sep 2021 01:45:50 +0000 (21:45 -0400)]
Windows Makefile.msc updates

Recognize latest version of Visual Studio Community 2017 version 15.9.39
Recognize latest version of Visual Studio Community 2019 version 16.11.3
The removal of the generated $(SRC)\tile.c file moved from
    nmake spotless
to
    nmake clean

3 years agoMakefile.gcc follow-up
nhmall [Wed, 15 Sep 2021 03:39:22 +0000 (23:39 -0400)]
Makefile.gcc follow-up

Errors in the CI after dependency update

3 years agomsdos Makefile.gcc dependency update
nhmall [Tue, 14 Sep 2021 16:48:42 +0000 (12:48 -0400)]
msdos Makefile.gcc dependency update

Copy the recently updated dependencies from sys/unix/Makefile.src
over to sys/msdos/Makefile.gcc.

3 years agoWindows Makefile.gcc dependency update
nhmall [Tue, 14 Sep 2021 16:36:29 +0000 (12:36 -0400)]
Windows Makefile.gcc dependency update

Copy the recently updated dependencies from sys/unix/Makefile.src
over to sys/windows/Makefile.gcc.

3 years agoWindows Makefile.msc dependency update
nhmall [Tue, 14 Sep 2021 14:25:49 +0000 (10:25 -0400)]
Windows Makefile.msc dependency update

Copy the recently updated dependencies from sys/unix/Makefile.src
over to sys/windows/Makefile.msc.

3 years agoUnix 'make depend'
PatR [Tue, 14 Sep 2021 09:06:14 +0000 (02:06 -0700)]
Unix 'make depend'

I recently changed a comment in objclass.h and that should have
triggered a full or nearly full rebuild but only resulted in a
couple of files being recompiled.  Instead of trying to figure out
why, I just ran Makefile.src through 'make depend' to force it to
be up to date.

A side-effect is that version.c won't be unnecessarily recompiled
every time nethack gets relinked.  The reason for that (date.h
being regenerated with new data) is handled by date.c now.

3 years agowindows visual studio project build tweaks
nhmall [Mon, 13 Sep 2021 15:32:59 +0000 (11:32 -0400)]
windows visual studio project build tweaks

3 years agoremove sp_lev execute bits
Pasi Kallinen [Sun, 12 Sep 2021 19:34:19 +0000 (22:34 +0300)]
remove sp_lev execute bits

3 years agoReveal the monster your strike moved
Pasi Kallinen [Sun, 12 Sep 2021 16:44:35 +0000 (19:44 +0300)]
Reveal the monster your strike moved

When you hit a small hidden monster (by eg. force-fighting)
that got moved by the strike, the monster stayed hidden, possibly
causing a sanity checking error.

Reveal the monster before hurtling it.

3 years agofix github issue #587 - incompatible save files
PatR [Sun, 12 Sep 2021 12:31:01 +0000 (05:31 -0700)]
fix github issue #587 - incompatible save files

Save files from before the 'disambiguate WHACK' patch were not
necessarily compatible with ones after it, leading to potential
restore problems.

Comments in objclass.h (from before the patch) suggested that
inappropriate assumptions were being made about field layout.
This deliberately introduces new incompatibility and increments
EDITLEVEL to caused earlier save and bones files to be thrown
away.

Fixes #587

3 years agofix github issue #589 - gremlin crash
PatR [Sat, 11 Sep 2021 10:04:04 +0000 (03:04 -0700)]
fix github issue #589 - gremlin crash

when fleeing hero who was wearing gold dragon scales/mail and not
wielding any weapon.

When a gremlin was made to flee "artifact light", code originally
intended for Sunsword attempted to format 'uwep' as an artifact.  For
gold scales/mail instead of that, it gave a sane but inappropriate
value if wielding something or segfaulted if not wielding anything.

Fixes #589

3 years agofix #K3440/github issue #586 - losing object info
PatR [Wed, 8 Sep 2021 00:50:50 +0000 (17:50 -0700)]
fix #K3440/github issue #586 - losing object info

when an unseen monster picks up an item that the hero knows some
things about.  That's intentional, but vision is turned off while
engulfed so throwing or dropping something while swallowed always
treated it as being handled by an unseen monster.

If hero is swallowed or held by a monster or poly'd and holding a
monster, behave as it the monster can 'seen' by touch when items are
added to its inventory.

Closes #586

3 years agoFix: running on ice sent hero in weird directions
copperwater [Tue, 7 Sep 2021 19:00:45 +0000 (15:00 -0400)]
Fix: running on ice sent hero in weird directions

This is because ice was being treated as a type of corridor rather than
a ROOM space, and running has rules for following similar terrain. In
reality it's not a corridor and should behave like normal room for
running purposes.

This was obvious in the valkyrie quest upper levels with ice fields, in
which running into the edges of the map obliquely, or into the corners
of the map, would send the hero flying around the edge in a different,
probably unintended direction.

3 years agoobj->spe doc: scroll of scare monster
PatR [Tue, 7 Sep 2021 00:36:52 +0000 (17:36 -0700)]
obj->spe doc: scroll of scare monster

3 years agofixes entry
Pasi Kallinen [Mon, 6 Sep 2021 18:02:48 +0000 (21:02 +0300)]
fixes entry

3 years agoNon-metallic gloves protect worn rings from shock
Guillaume Clemens [Fri, 30 Jul 2021 14:37:17 +0000 (16:37 +0200)]
Non-metallic gloves protect worn rings from shock

3 years agoResistances gained from worn or wielded items also protect inventory
Pasi Kallinen [Mon, 6 Sep 2021 17:06:19 +0000 (20:06 +0300)]
Resistances gained from worn or wielded items also protect inventory

3 years agofix #K3436 - crash during restore
PatR [Sun, 5 Sep 2021 22:44:00 +0000 (15:44 -0700)]
fix #K3436 - crash during restore

triggered by Grayswandir's hallucination resistance.  If the game
is saved while hero is hallucinating but having that be suppressed
by wielding Grayswandir, is riding, and the steed is on an object,
then during restore the hero's location will be updated because
of the presence of the object but the attempt to display the hero
there is made before u.usteed has been restored and fails.

3 years agoMove sanity checking to start of main loop
Pasi Kallinen [Sun, 5 Sep 2021 07:14:12 +0000 (10:14 +0300)]
Move sanity checking to start of main loop

... just after clearing the object bypasses, as some
of the monster movement code may use object bypass flags.

3 years agoFixes entry for "Disambiguate blunt weapons"
PatR [Sat, 4 Sep 2021 21:46:24 +0000 (14:46 -0700)]
Fixes entry for "Disambiguate blunt weapons"

and additional comments.  Pull request #584 expands the oc_dir field
of objects[] from 2 bits to 3 in order to hold the weapon strike-
type bit mask.

Closes #584

3 years agoDisambiguate blunt weapons
copperwater [Thu, 2 Sep 2021 20:22:05 +0000 (16:22 -0400)]
Disambiguate blunt weapons

Currently weapons are set up as piercing, slashing, or whacking, using
their object's oc_dir field, with the intention that certain weapons
can classify as both. However, since oc_dir is only 2 bits and WHACK is
0, there's no way to unambiguously express some of these combinations.
Certain weapons such as the lucern hammer are defined as combination
piercing/blunt weapons, but the game just sees it as a piercing weapon.

This commit adds a third bit to oc_dir and promotes the WHACK constant
to its own bit. Nothing should be affected by this (wand directions and
the like should remain working as usual) other than the
blunt-and-something-else weapons being defined properly.

3 years agofixes entry for "Suddenly you cannot see it"
PatR [Sat, 4 Sep 2021 21:29:15 +0000 (14:29 -0700)]
fixes entry for "Suddenly you cannot see it"

Pull request #585 fixes incorrect XOR logic caused by changes
accompanying introduction of gold dragons 5 or 6 weeks ago.

Closes #585

3 years agoFix: 'Suddenly you cannot see it'
Michael Meyer [Fri, 3 Sep 2021 20:55:37 +0000 (16:55 -0400)]
Fix: 'Suddenly you cannot see it'

Updates to m_dowear_type(worn.c) in 5a09a01a13 inadvertently reversed
the effect of an xor near the end of the function, causing it to go from
testing whether a monster's status as 'seen' or 'unseen' changed over
the course of the function to testing whether it remained the same.

As a result, whenever an unseen, invisible monster donned a piece of
armor anywhere on the map, the message 'suddenly you cannot see it'
would be printed.  Fix the xor so that it goes back to testing whether
visibility changed since the start of the function.

3 years agoFix eel hiding in dry land
Pasi Kallinen [Fri, 3 Sep 2021 10:27:36 +0000 (13:27 +0300)]
Fix eel hiding in dry land

When an eel was hiding in a pool and a rolling boulder trap
launched a boulder on top of the pool, and the boulder then
filled the pool, the eel ended up hiding on the dry land.

As a stopgap measure, kill off any monster that is in the
pool location when the boulder hits the pool. This should
probably be expanded to handle flying monsters differently.

3 years agoFix: replace_terrain used wrong y2 coordinate
copperwater [Thu, 2 Sep 2021 13:36:45 +0000 (09:36 -0400)]
Fix: replace_terrain used wrong y2 coordinate

3 years agoTest for replace_terrain coordinates
Pasi Kallinen [Fri, 3 Sep 2021 05:27:17 +0000 (08:27 +0300)]
Test for replace_terrain coordinates

3 years agofixes entry for pull request #565 - booze
PatR [Thu, 2 Sep 2021 22:54:17 +0000 (15:54 -0700)]
fixes entry for pull request #565 - booze

Drinking booze has more impact on hero with an empty stomach.

Closes #565

3 years agoAmplify booze effect if drinking on empty stomach
Michael Meyer [Tue, 3 Aug 2021 21:05:22 +0000 (17:05 -0400)]
Amplify booze effect if drinking on empty stomach

Drinking booze on an empty stomach will amplify its effects
(i.e. increase the duration of the resulting confusion); stuffing
yourself before drinking will have the opposite effect.

3 years agoHandle buried zombifying corpses
Pasi Kallinen [Thu, 2 Sep 2021 17:54:32 +0000 (20:54 +0300)]
Handle buried zombifying corpses

When a zombifying corpse is buried, allow it to zombify and
dig itself out of the ground.

Also allow wishing for zombifying corpses.

3 years agofixes entry for polyfodder patch
PatR [Sun, 29 Aug 2021 22:40:05 +0000 (15:40 -0700)]
fixes entry for polyfodder patch

Add a fixes entry for the "Count all poly'ing tins as potential sliming
cures" commit.

Closes pull request #578

3 years agoCount all poly'ing tins as potential sliming cures
Michael Meyer [Fri, 20 Aug 2021 23:20:00 +0000 (19:20 -0400)]
Count all poly'ing tins as potential sliming cures

Popeye, used to check whether eating a particular tin is a potential
lifesaving action, considered tins of chameleon meat a cure for sliming
(since you can polymorph into a fiery monster), but didn't credit the
same possible curative power to other tins which can polymorph the hero.

Use the polyfodder macro (used elsewhere to check whether eating
something will polymorph a monster/pet) to determine whether a tin will
polymorph the hero.

3 years agobuild failure detected in CI
nhmall [Sun, 29 Aug 2021 03:10:49 +0000 (23:10 -0400)]
build failure detected in CI

The build in the CI was failing after commits today due to this error:
prob error for class 4 (28%)

It was caused by running
makedefs -o

Remove unnecessary invocation of makedefs with outdated options from
aftermakedefs.proj

3 years agodelete obsolete variable 'monstermoves'
PatR [Sat, 28 Aug 2021 23:24:23 +0000 (16:24 -0700)]
delete obsolete variable 'monstermoves'

Fixes entry and EDITLEVEL increment for 'Remove g.monstermoves'
commit.  Invalidates old save file contents.

Closes pull request #579

3 years agoRemove g.monstermoves
copperwater [Sun, 22 Aug 2021 13:53:24 +0000 (09:53 -0400)]
Remove g.monstermoves

It's redundant with g.moves, so there is no more need for it.

Way, way back, it looks like g.moves and g.monstermoves can and did
desync, where g.moves would track the amount of moves the player had
gotten (and would therefore increase faster if the player were hasted)
and g.monstermoves would track the amount of monster move cycles, aka
turns. But this has not been the case for a long time, and they both
increment together in the same location in allmain.c. There are no
longer any cases where they will not be the same value.

This is a save-breaking change because it changes struct
instance_globals, but I have not updated the editlevel in this commit.

3 years agoFixes entry
Pasi Kallinen [Sat, 28 Aug 2021 14:07:56 +0000 (17:07 +0300)]
Fixes entry

3 years agoRemove requirement of object probs adding to 1000
copperwater [Mon, 23 Aug 2021 00:01:14 +0000 (20:01 -0400)]
Remove requirement of object probs adding to 1000

When discussing the recent commit that removed makedefs -o from the
build process, nhmall pointed out that a sanity check ensuring all
objects within one class add up to 1000 probability had been removed as
well. This requirement was a perennial thorn in the side for anyone
doing anything that touches object probabilities, because allocating
probability to something meant deciding what to take it away from,
without a good way to evenly distribute that across all the other
members of the object class.

I had gotten around this in xNetHack by removing the sanity check and
making mkobj() total up the probability within an object class and then
using that instead of 1000. This commit takes a similar approach, but
instead of inefficiently recalculating the sum every time mkobj() is
called, it instead computes it at the start of the game or when
restoring the save file and stores it in a global variable.

This fixes a slight bias problem with rings - they are all supposed to
be of equal probability, but there are 28 of them and 1000 is not evenly
divisible by that, so the old formula made the later rings slightly more
likely. Now instead of a 35/1000 or 36/1000 chance, they are all
uniformly 1/28. (Internally they have a oc_prob of 1 now, not 0).

Gems are also weird, because their oc_prob values change every level.
This ought to have still worked without a change, because the arcane
formula for assigning the probabilities would still end up with them
adding to 1000. But I added in code to reset the total gem probability
anyway; this may help make the formula less arcane in the future.

There is still a sanity check against object classes having a nonzero
number of objects but zero total probability, in which case an
impossible will be thrown and every member of the class will be given
equal probability. I also downgraded the "probtype error" panic in
mkobj() to an impossible because it has a reasonable failure case -
return the first item in that class.

3 years agoGuidebook tweaks for ^E, section 5 header
PatR [Thu, 26 Aug 2021 22:32:52 +0000 (15:32 -0700)]
Guidebook tweaks for ^E, section 5 header

Describe #wizdetect as revealing hidden things rather than searching
for hidden things since the latter is described more than once as
possibly needing multiple tries.

For plain text output, the "Rooms and corridors" section header was
harder than necessary to notice because it seemed to run together
with the list of commands preceding it.
|
| u    #untrap
|
| 5.  Rooms and corridors
|
Inserting an extra blank line in between them is helpful.  That isn't
needed for Postscript/PDF output because the text of the section
title is rendered with bold font, but I didn't attempt to make the
extra line be conditional.  The 'roff directive is added as a comment
to the TeX source without knowing whether an extra blank line would
be useful there (doubtful).

3 years agoFix ball bypass sanity complaint
Pasi Kallinen [Thu, 26 Aug 2021 15:46:22 +0000 (18:46 +0300)]
Fix ball bypass sanity complaint

Be punished, get swallowed, drop the ball inside the monster
via the 'D' drop, kill the swallower - this issued a sanity
check complaint about the ball bypass flag.

In this case, the ball was "floating", not on any object chain,
when dropped inside the monster, so clear_bypasses didn't
clear the flag.

3 years agoReindent main loop
Pasi Kallinen [Thu, 26 Aug 2021 11:19:36 +0000 (14:19 +0300)]
Reindent main loop

No code change, just reindenting the main loop, as it wasn't
reindented when the inner part was split into separate function.

3 years agoClear bypasses at beginning of main loop
Pasi Kallinen [Thu, 26 Aug 2021 11:11:57 +0000 (14:11 +0300)]
Clear bypasses at beginning of main loop

Object bypass flag is used to check if an object was already
handled in an iteration loop, in cases where the linked list order
may change during iteration. The flags should never stay set
past a turn, if any were used.

Reset the bypass flags at the beginning of the main loop, without
checking g.context.move -flag; that flag gets reset if hero lifesaved.