Commit Graph

4296 Commits

Author SHA1 Message Date
nhmall
ba64bb8ce2 out-of-bounds access in farlook pr592
https://github.com/NetHack/NetHack/pull/592 comment states:
"In commit db68395, most of the instances of xdir and ydir here were
changed to u.dx and u.dy, but not all of them. The remaining ones are
out-of-bounds on xdir and ydir, because i is always set to 12 from an
earlier loop and is no longer involved in handling user input. They
should be u.dx and u.dy like the rest."
2021-10-16 10:16:13 -04:00
PatR
d9bbad8e6e fix github issue #606 - shop wall repair
triggering an impossible warning about "wall_angle: unknown" due
to the known conflict between door state and wall info which both
overlay the flags field for map locations.

Reported and diagnosed by vultur-cadens:  if a shop's wall was dug
open, followed by use of locking magic to plug the gap with a door,
and then unlocking that door, the D_CLOSED door flag was left as
invalid wall_info when shop damage was repaired.  Map re-display
complained.  Leaving the door locked or opening it after unlocking
did not result in any complaint because the values for those door
states do not conflict with wall angle values.

The problem was reproducible and is now fixed by adding an extra
field to the shop damage structure.  A similar change has been
made to the vault guard's 'fake corridor' structure but I have no
test case for that so don't know whether it makes any difference.
At least it doesn't seem to have broken anything.

Existing save and bones files are invalidated by the fixes.

Fixes #606
2021-10-15 15:43:23 -07:00
nhmall
53bb04d9ad fixes entry for consoletty.c fix
Closes #604
2021-10-12 21:23:29 -04:00
nhw_cron
9c667501b6 This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2021-10-11 20:08:57 -04:00
PatR
8ec322b87e last? boulder change - Guidebook update
Describe the new feature of m<dir> making it feasible to move to a
boulder'd spot without pushing.  Giving specific information among
vague descriptions is awkward....

While in there, move a handful of sentences to separate lines as per
the 'roff guidelines.  I did the same for Guidebook.tex even though
it's not needed there, to try to keep things parallel.
2021-10-11 14:50:29 -07:00
nhmall
7405d1fa05 fix misaligned potion colors
Misaligned potion colors due to lack of reset_glyphmap() following obj shuffle.

This issue only impacted a new game
2021-10-11 13:36:10 -04:00
PatR
e42488ca10 and even more boulders...
Revise the m<dir>-toward-boulder handling to let a hero who would be
able to squeese into the boulder's spot if it was blocked from being
pushed to do the squeeze without any pushing.

Unlike the previous changes, this might have an impact on play.  It
allows squeezing under then stepping past an unblocked boulder that's
in a corridor in order to be able to push it back the other direction
where maybe there's more room to maneuver it out of the way.
2021-10-10 18:05:11 -07:00
PatR
fc00ced6f4 yet more boulders: allow m<dir> to not push them
Allow a hero polymorphed into a giant to move to a boulder's spot
via m<dir> no-pickup move, instead of having to push it until the
way is blocked by something and then having push failure move hero
to the spot.

Also change m<dir> when not a giant to no longer push the boulder.
No time will elapse when not moving unless hero who didn't know
that there was a boulder there learns that one is.  Since no actual
push attempt gets performed, player doesn't learn whether there is
anything beyond the boulder that inhibits it from being pushed.
2021-10-10 15:02:21 -07:00
nhmall
6eecfbc28b fix an expanded-glyphs regression
Restore behavior that was unintentionally overlooked during
the expansion of glyphs earlier this year.
2021-10-09 11:34:37 -04:00
PatR
536a5acd20 fixes37.0 entry typo 2021-10-08 13:24:54 -07:00
PatR
a0e58fe323 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.
2021-10-06 13:46:27 -07:00
PatR
c3e5aaf8ba 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.
2021-10-03 14:15:02 -07:00
PatR
b1d76a772f 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
2021-09-30 13:08:27 -07:00
nhmall
6073f5a553 more fixes entry tinkering for consistency 2021-09-30 14:37:37 -04:00
nhmall
6e9b1a2f06 correct a fixes37.0 entry 2021-09-30 14:26:10 -04:00
PatR
017a8687e0 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
2021-09-30 05:26:04 -07:00
nhmall
bdfd41d203 missed a couple 2021-09-26 16:12:50 -04:00
nhmall
94ddf4329c update fixes37.0 and doc/Guidebook.txt
make format of pull request entries consistent
2021-09-26 15:48:59 -04:00
nhw_cron
756d38776d This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2021-09-26 15:47:15 -04:00
nhmall
b1da4dea70 Merge branch 'supply-missing-changes' of https://github.com/argrath/NetHack into several-pr 2021-09-26 08:56:30 -04:00
nhmall
b2920ab728 Merge branch 'delete-extra-lines' of https://github.com/argrath/NetHack into several-pr 2021-09-26 08:56:08 -04:00
SHIRAKATA Kentaro
96679152ef Supply missing changes
Some changes applied to Guidebook.mn were not applied to Guidebook.tex.
This commit supplies them.
2021-09-25 23:28:16 +09:00
PatR
eaaeb81a9f 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.
2021-09-24 12:01:54 -07:00
SHIRAKATA Kentaro
83c626b707 delete extra lines 2021-09-23 03:30:57 +09:00
nhmall
9e46366a5e add fixes37.0 entries for the expanded-glyphs 2021-09-20 10:15:05 -04:00
Pasi Kallinen
176d5b8463 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>.
2021-09-19 21:20:32 +03:00
Pasi Kallinen
5d3e237ffc Izchak occasionally stocks wands/scrolls/spellbooks of light
This comes from xNetHack by copperwater <aosdict@gmail.com>
2021-09-19 20:52:19 +03:00
Pasi Kallinen
b23ff20c6a 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>
2021-09-19 13:57:47 +03:00
nhw_cron
74a0ede6d9 This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2021-09-18 11:02:33 -04:00
nhmall
9b57784348 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
2021-09-18 10:04:25 -04:00
nhmall
22b2ef8f2b Guidebook.tex update from cron daily 2021-09-18 07:32:25 -04:00
nhmall
b6e882d79d fix error in Guidebook.tex and Guidebook date bump 2021-09-17 22:44:16 -04:00
Pasi Kallinen
b30061b5ad 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.
2021-09-17 21:00:06 +03:00
PatR
e43ec0cef1 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).
2021-09-15 20:56:06 -07:00
PatR
583fb60835 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
2021-09-12 05:31:01 -07:00
PatR
d118ac52af 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
2021-09-11 03:04:04 -07:00
PatR
dc3f1447c7 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
2021-09-07 17:50:50 -07:00
Pasi Kallinen
e7e7bca2a3 fixes entry 2021-09-06 21:02:48 +03:00
Pasi Kallinen
9942b65df7 Resistances gained from worn or wielded items also protect inventory 2021-09-06 20:24:44 +03:00
PatR
9f230c3cd4 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.
2021-09-05 15:44:00 -07:00
PatR
dd7b9f2a8a 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
2021-09-04 14:29:15 -07:00
PatR
3a99a5e388 fixes entry for pull request #565 - booze
Drinking booze has more impact on hero with an empty stomach.

Closes #565
2021-09-02 15:54:17 -07:00
PatR
43db84cd13 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
2021-08-29 15:40:05 -07:00
PatR
c57abab020 delete obsolete variable 'monstermoves'
Fixes entry and EDITLEVEL increment for 'Remove g.monstermoves'
commit.  Invalidates old save file contents.

Closes pull request #579
2021-08-28 16:24:23 -07:00
Pasi Kallinen
b76a213caf Fixes entry 2021-08-28 17:07:56 +03:00
PatR
ecee4e8610 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).
2021-08-26 15:32:52 -07:00
PatR
48252705b8 less elapsed time: ! and ^Z
Suppress any time spent in a sub-shell or in the background when
accumulating total elapsed play time.

This won't help for leaving the game idle instead of saving and
restoring.  That's a can of worms I'd prefer to leave sealed.
2021-08-25 14:49:58 -07:00
PatR
e67f45fc5c fix #K3422 - mimic remains as 'strange object'
even when protection from shape changers is in effect.  I'm not sure
why mimicking other things doesn't trigger the same sanity check
warning.  This fix works for the strange object case and I assume
that it doesn't break the more general case.

When investigating, I noticed that save and restore (even leaving
the level and then returning) causes cancelled shape changers to be
uncancelled.  Treat being cancelled similarly to having to having
protection from shape changers in effect:  shape changer is forced
to revert to its innate form and not allowed to change shape.
2021-08-24 08:09:30 -07:00
nhmall
96d095d08d reword fixes37.0 entry 2021-08-22 19:34:12 -04:00
nhmall
07fadd5e69 fix nhl_loadlua() failures on Windows
The [dlb_]fopen() requires an RDBMODE argument on Windows.
ftell(), fseek(), and fread() interactions can be problematic otherwise.
2021-08-22 19:25:13 -04:00