Commit Graph

570 Commits

Author SHA1 Message Date
nhmall
d064ac2cda more cast style consistency 2023-11-13 20:31:02 -05:00
PatR
4512ae5bbe warning fix
Adding U suffixe to ELF_WT lead indirectly to comparing signed rn2()
with macro specifying an unsigned magic constant.
2023-11-10 10:33:50 -08:00
Michael Meyer
a1b1f3b250 Try to unify "back on solid ground" messaging
Put everything through a single function that can handle all the
complicated parts of using the correct proposition for different terrain
types, and will not just call things "solid ground" indiscriminately.
This got complicated but I'm not sure if it's possible to do it much
simpler while still using the distinct names for each type of terrain
(unless you are OK with the sentences sounding sort of wonky).
2023-11-07 16:13:55 -08:00
Michael Meyer
ccf997b28b Cache and restore gb.bhitpos in water_damage_chain
If throwing an item while levitating sent the hero hurtling into a wall
of water, the item would land in the water due to water_damage_chain's
use of bhitpos.  Restore the previous value when it is finished to avoid
interfering with the use of bhitpos further up the call stack.
2023-11-03 11:04:35 -07:00
PatR
fa0f3751a3 fix #K4026 - "object lost" panic during theft
"object lost" panic occurred when hero's worn amulet of magical
breathing was stolen.  This prevents drown() -> emergency_disrobe()
from dropping an item while in the midst of it being stolen, avoiding
the possibility of it no longer being in inventory when the theft
completes.  There may be variations other than drowning that lead to
unwear -> drop-or-destroy that are still vulnerable, and this fix can
potentially cause items to vanish from hangup save files.

It also has a side-effect of not being able to drop levitation boots
to lighten encumbrance enough to crawl out of water if the drowning
occurs while they are being taken off, not just when being stolen,
even though they should be easily droppable in such circumstance.  The
hero will just need to drop other things instead.
2023-11-01 01:54:32 -07:00
nhmall
6cbefc7c2d Revert "granular verbose message suppression mechanics"
This reverts commit be76727265.
2023-10-29 20:39:07 -04:00
Pasi Kallinen
ff4f81af1b Make rolling boulders hit walls and trees
While testing something else, I noticed rolling boulders
just ignored walls and trees; in normal play this isn't
a problem - but should probably make boulders handle other
terrain too.  Lava and water is already handled correctly.
2023-10-21 18:42:43 +03:00
Michael Meyer
fa1f1134c8 Disambiguate b_trapped null bodypart value
b_trapped was treating 0 as a null value for its bodypart parameter, but
0 is actually the value of ARM, so b_trapped(..., ARM) would be treated
as intending no A_CON abuse.  Add NO_PART = -1 to the bodypart_types
enum, and use that instead of 0 as the "no body part" value in
b_trapped, so that ARM can be passed to it without any ambiguity.

aosdict identified this issue in xNetHack and handled it differently; he
added NO_PART with a value of 0, incremented the existing bodypart_types
values, and padded the body part arrays so the actual body parts would
start at index 1.  I think using NO_PART = -1 is simpler, but that's an
alternative approach that can be used instead -- it is advantageous in
that it automatically fixes any other places where 0 is assumed to be a
non-body-part value that I may have overlooked.
2023-09-27 10:40:27 +03:00
PatR
1a64ee1c28 github PR #259 - paranoid_confirmation:trap
Fairly old pull request from copperwater:  add new paranoid_confirm
setting 'trap'.

The old commit suffered from bit rot and merging needed too much
fixing up despite there not being many bands of change in the commit's
diffs.  I ultimately redid it from scratch, although the two biggest
chunks of code started with copy+paste of the pull request's commit.

It operates like paranoid:pray.  Setting paranoid:trap adds a new
"Really step into <trap>?" y/n prompt when attempting to move
into/onto a known trap, even if an object covers it on the map.
Setting both 'paranoid:Confirm trap' turns that into a yes/no prompt.
(Adding 'Confirm' affects other paranoid confirmations; in addition
to requiring yes<return> rather than just y to accept, it also forces
no<return> to reject.)

However, moving into a known trap that is considered to be harmless
behaves as if no trap was present.  Some of the trap classification
might be out of date; several types of traps have undergone changes
since implementation of the original pull request, notably anti-magic
field.  When the hero is hallucinating, all known traps are considered
harmful since the map no longer reliably describes them.

Preceding a movement command with the 'm' prefix also behaves as if
no trap was present, bypassing confirmation for that move, similar to
how paranoid:swim currently behaves.  Being stunned or confused also
behaves as if no trap was present, taking priority over hallucination.

This updates the documentation.

Supersedes #259
Closes #259
2023-09-08 15:55:31 -07:00
Michael Meyer
8fa53d6ac5 Adjust seenres when observed attack succeeds
If a monster sees an elemental attack succeed from some other creature
or environmental danger, it will be willing to try those attacks again.
2023-08-29 12:05:48 +03:00
PatR
1b79f00a39 more PR #1077 - #sit on floor trap while Flying
Sitting on a squeaky board wasn't triggering it even after the
handler for that type of trap allowed VIASITTING to override Flying.
The check_in_air() test for floor traps didn't have the same override,
so the squeaky board handler didn't get called.

This fixes that, which led to inconsistency with some other trap
types, and additional fixes for pits and bear traps.  There might be
others that still behave oddly.  For example, if flying over a hole,
using #sit yields
 |You land.  There's a gaping hole under you!  You don't fall in.
I think that's a message phrasing issue rather than a falling trap
issue; if you want to go down, use '>' instead of #sit.  On the other
hand, you do now fall into pit traps for #sit while flying over them.
2023-07-09 14:51:30 -07:00
Ardub23
6406c9d055 Sit to trigger squeaky board even if flying
If the hero deliberately sits on the floor while flying over a squeaky
board, then either they're trying to squeak it on purpose or they haven't
noticed it. Either way, sitting should trigger it.
2023-07-09 09:28:09 -06:00
Michael Meyer
ab37888b36 Restore altar destruction from magical digging
Especially powerful magic is meant to be able to destroy altars
(breaking a wand of digging or using a drum of earthquake), but it was
being blocked by a check added to maketrap() in a7f6460 designed to
prevent wizard-mode trap wishing from overwriting stairs.  The check was
refined in 6a3d82c to add an exception for digging up graves, but
continued to prevent the destruction of other types of
previously-destructible terrain.

Since this block was a side effect of an attempt to add some guard rails
to wizmode terrain wishes, and the code to explicitly permit the
destruction of other furniture with especially powerful magic is still
present, it doesn't seem like it was actually intended.  Open up terrain
destruction by digging magic a bit more by excluding only
non-destructible terrain, not all furniture other than graves, from
being overwritten by pits and holes.

Also, use AM_SANCTUM to more precisely identify non-destructible high
altars in dig_check() rather than checking whether the hero is on the
Astral or Sanctum levels.
2023-07-07 10:41:18 -07:00
PatR
2d6d151b28 PR #1009 - higher statue trap difficulty
Pull request from NulCGT:  make statues created for statue traps be
5 to 10 points higher in difficulty than the default would be.

5 to 10 points of difficulty higher is already used for figurines.
The pull request chose the same amount but I've reduced it to 3 to 6.
Partly so that they won't be the same, partly so that they won't be
too hard when activated, and partly so that the creature won't be
quite as obvious a give away that the statue is a trap.

Closes #1009
2023-07-02 15:27:58 -07:00
Kestrel Gregorich-Trevor
2dd0af630e Adjust statue traps to be biased toward more difficult monsters. 2023-07-02 15:16:57 -07:00
PatR
8fd8d1defa Mitre of Holiness
If the priest quest artifact Mitre of Holiness (a helm of brilliance,
so crystal helmet) is acquired via the quest (rather than by wishing)
make it start out tempered (aka crackproof|erodeproof).
2023-06-17 13:27:40 -07:00
PatR
1bd966f826 fix issue #1061 - dipping container into water
Issue reported by loggersviii:  dipping a container into an uncursed
potion of water mentions water getting into the container.  That
happens even when that type of potion hasn't been discovered yet.

Make POT_WATER become discovered if this occurs.  Doesn't apply when
hallucinating where a random liquid is mentioned instead of water.

Fixes #1061
2023-06-15 02:29:51 -07:00
PatR
e9c58c2fe4 breaking crystal armor
Instead of a 5% chance for crystal plate mail or crystal helmet to
break each time it's subjected to breakage, switch to a 10% chance
but the damage is treated as erosion rather than break/don't-break.
'crystal foo' will need to go through four stages of damage before
breaking:  cracked crystal foo, very cracked crystal foo, thoroughly
cracked crystal foo, then gone.  Crackproof handling is included,
described as tempered crystal foo.

It mostly still applies to throwing and kicking the item.  Having
some hits trigger damage might be worthwhile but isn't implemented.

Object creation within lua code probably needs to be updated, and
when the Mitre of Holiness is created in the priest/priestess quest
it should start out as tempered (erodeproof).  Perhaps it ought to
be erodeproof regardless of where/how it's created.
2023-06-14 15:54:04 -07:00
PatR
450f060132 github issue #1060 - crystal helmet
Issue reported by vultur-cadens:  changing helm of brilliance to
crystal made it stop being classified as "hard helmet" so it gave
less protection against things falling onto the hero's head.

Change the is_metallic() tests used on helmets to new hard_helmet().
Unlike when thrown, crystal helmets don't break when objects fall
on them.

Fixes #1060
2023-06-14 06:13:11 -07:00
PatR
59677e7440 rewrite safe_teleds()
The teleport to safety routine would try to find a viable spot 400
times, the first 200 rejecting trap locations and the last 200
accepting such.  While testing various escape from lava variations
recently, I noticed that I could fail to reach safety even when there
was an open spot immediately adjacent to me.  I added a BandAid(tm)
to make another 400 tries if the first attempt failed, but that was
clumsy and still didn't guarantee picking a viable spot.

This adds a new routine, collect_coords(), which will gather a list
of coordinates for the entire map.  safe_teleds() goes through them
one by one until either finding a spot or exhausting the possibilies,
without randomly trying and retrying the same spot multiple times and
without missing other potential spots, also without just scanning the
map from left to right and top to bottom or similar.

Various other things which retry over and over, and especially the
ones which make a bunch of random attempts and then fallback to trying
every spot on the map, could be switched over to this, at least for
the falling back phase.  Right now collect_coords() is local to
teleport.c but that could be easily changed.

The try-at-random method is much quicker when there are lots of
available spots but the gather-shuffled-candidates method is
guaranteed to succeed if success is possible.  The way safe_teleds()
is presently using it collects the list with all locations within
2 steps first, then those within 3 to 4, then 5 to 6, and so on out,
randomized within each block of ranges.  So the destination will be
within one step of being as close to the starting spot as possible
but not always immediately adjacent when that happens to be available.
2023-05-15 01:42:13 -07:00
PatR
2646688e2d back_on_ground()
Replace a couple of hardcoded "back on solid ground" messages with
something more versatile.

Also, make life-saving handling for failed rescue from drowning
similar to that of failed rescue immolation by lava.  If there are
any cases where more than two tries is needed, they elude me.  The
new code doesn't confer temporary water walking if emergency teleport
fails; perhaps it should.
2023-05-15 01:08:04 -07:00
PatR
dd7d7f2eae fuzzer vs lava, take III
Change dying in lava to attempt life-saving at most twice.  The first
time might be via amulet or via declining to die.  The second time
can only be via declining to die after failing to teleport to safety
the first time, but could happen in explore mode as well as in wizard
mode, either interactive or fuzzer.

If the hero dies twice without ending the game, confer temporary fire
resistance and water walking so that other actions can be attempted.
After 5 turns without getting away from the lava or doing something
to acquire those capabilities, the hero will be subject to falling in
again.

Then the whole cycle might repeat, even many times, but the fuzzer
will eventually choose ^V or #wizmakemap and escape.  Players in
explore mode will either figure out a way to get out of it or
eventually have to give up but can try as many times as they like,
not that much different than being cornered by a deadly monster.
2023-05-08 15:21:03 -07:00
PatR
210387c176 break fuzzer out of life-save loop, take II
When being burned up by lava, die 20 times before giving up the
attempt at life-saving (was unlimited).  Giving up leads to the hero
standing on lava rather than dying.  Normally moveloop() dunks the
hero again on next turn but fuzzer life-saving now has a chance to
confer temporary fire resistance.  So hero might have an opportunity
to level teleport or use ranged attacks that free up spots so have
somewhere available to teleport to safety if/when dunked again.

The recent code to give up on trying to resurrect the dying hero
after 15 deaths on the same move is extended to 20.  They apply to
each of the 20 lava resurrect attempts but still doesn't guarantee
that the hero will eventually get free before done() gives up.
2023-05-08 01:35:21 -07:00
PatR
6de996971b fix #K3915 - "deleting worn obj" warning
Knocking a monster into lava triggering impossible warnig "deleting
worn object" for a wooden shield.  The monster had to be wearning
flammable armor and be fire resistant to survive instead dying and
dropping inventory, and it couldn't be a creature that can survive at
lava locations like a salamander and the armor needed to already be
thoroughly burnt.

It wasn't hard to figure out what needed to be fixed, but it was very
hard to reproduce the situation in order to verify that fix.  The
report was for monster vs monster knockback but I jousted with a lance
instead.  I still don't understand why burning up a worn wooden shield
triggered the warning but burning up a worn orcish cloak did not.
2023-05-06 00:08:35 -07:00
PatR
e28d15f491 endgame portal fix
A recent change to prevent creating webs at water locations also
deliberately prevented them at air locations but had the unintended
side-effect of preventing creation of magic portals on the Planes
or Air and Water.  Those two levels always place the portal in air.
Explicitly allow air if the trap being created is a magic portal.
2023-05-05 17:42:57 -07:00
PatR
d2f4edc209 'm #genocided' bit
Overlooked part of customizing the #genocided sort menu.

A bit of unrelated trap.c formatting included.
2023-05-03 05:20:13 -07:00
PatR
b3580289be fix github issue #1017 - webs in/on water
Reported by copperwater, it was possible for a web to be created
at a water or lava location.  It would not be displayed even after
being discovered; showing the terrain superseded showing the trap.
But it functioned normally and could trap the hero.  Webs pull the
victim to the floor so hero would drown or burn up on next move
even if the spot had been reached while floating or flying.

A monster spider couldn't survive at a water or lava location, but
a poly'd hero could.  Creating a web via #monster or wizard mode
wish could result in it affecting some unsuspecting player via bones.

Disallow creation of webs at water, lava, and air or cloud spots.
(They're already disallowed at furniture spots.)

Fixes #1017
2023-05-01 01:54:35 -07:00
nhmall
826ce951e7 get rid of NetHack macro conflict with curses routine delay_output() 2023-04-21 08:25:53 -04:00
copperwater
dad1c3f8b7 Fix: breathless monsters always generate in water in special levels
... unless explicitly specified to generate at a specific point or
within a specific area. But if they are permitted to generate anywhere
on the level, and it contains water, they always end up in the water. I
noticed this when trying to explicitly specify ghouls to generate
anywhere on a level with a minimal amount of water.

This was due to the definition of "amphibious" being conflated with
"breathless", such that all breathless monsters counted as amphibious.
There are plenty of breathless monsters in the game that decidedly don't
normally inhabit water, such as undead, but they would pass the
amphibious() check in pm_to_humidity and thus the game decides that they
must generate in wet terrain if there is any available.

This fix takes the approach of changing amphibious() so that it no
longer checks the M1_BREATHLESS flag and only considers M1_AMPHIBIOUS,
then updating the places where amphibious() and Amphibious are used
accordingly. I also added a new macro cant_drown() which wraps up
swimming, amphibiousness, and breathlessness because these three things
are frequently checked together in the context of whether something
should drown.

Places where amphibious() or Amphibious did NOT have an extra
breathless() or Breathless check added on, and thus where behavior has
been changed:
- The pm_to_humidity function (to fix the bug).
- Player vs water in goodpos; it didn't seem like being polymorphed into
  a breathless non-amphibious monster should make it fair game to
  randomly teleport into water even though it's technically safe.
- Awarding extra experience when killing an eel. (So the hero will get
  the extra experience if they are polymorphed into a breathless
  non-amphibious monster and don't have magical breathing. Very much an
  edge case.)
2023-04-16 09:57:41 +03:00
PatR
bbd76562b0 redo fix for issue #1003 - energy drain
The fix in commit 14d003c4ba prevented
current energy from ending up 1 point above maximum energy but it
didn't preserve the intent of splitting the drain with up to half
coming out of maximum and the remainder out of current.  This restores
that intent but now only does so when maximum is more than the full
drain amount rather than when it is more than the up-to-half portion,
becoming less harsh when hero's max energy is very low.  If current
is also very low then max energy will be reduced anyway, but by less.

Some unrelated formatting of invent.c has gotten mixed in.

Revises #1003
2023-04-08 16:40:21 -07:00
PatR
14d003c4ba fix github issue #1003 - anti-magic field energy
Issue reported by vultur-cadens:  when trap effect of an anti-magic
field reduced maximum energy, the result might end up with current
energy being one point higher than new maximum.

Fixes #1003
2023-04-07 23:34:19 -07:00
PatR
dad67436e6 fix #K3895 - 'o' at own spot during pass-walls
If standing at the location of a closed door while having Passes_walls
ability, attemping to open that door with 'o' reported "you don't find
anything here to loot".

Using 'o' to loot for direction ./>/< is intentional but it ignored
the possibility of there also being a closed door present.  When the
latter applies, only switch from open to loot for direction '>' so
that '.' (and '<') will open the door.  Doesn't matter for creatures
that can ooze under a closed door--trying to use 'o' gets rejected for
them because they lack hands.

Also allow hero in Passes_walls form to use 'c' when at open door spot.
(For creatures that ooze under doors, 'c' is rejected just like 'o'.)

Unrelated:  fix a typo in a recently added comment.
2023-03-29 13:48:42 -07:00
PatR
0532eae7d2 feedback when escaping lava
Fix the duplicate feedback given when landing on one or more items
after teleporting out of lava.

This also avoids "you find yourself back on solid water" if you are
able to survive at a water location and safe_teleds() puts you on one.
2023-03-27 17:08:18 -07:00
PatR
3ce02acbc5 fix #K3888 - object lost panic cased by lava
Report was for spell-casting monster using the destroy armor spell on
hero's levitation boots while hero was floating over lava.  The boots
became unworn but still in inventory, hero dropped into lava, the
boots happened to be an inventory item which got burned up, then the
call stack unwound back to the destroy armor routine which tried to
finish by deleting them but they were already gone by then.  Could
also happen for black dragon breath, hero reading scroll of destroy
armor, or overenchanting the boots with scroll of enchant armor, so
not so unlikely that nobody would be expected to notice.

Initially I couldn't reproduce the object lost panic.  It only happens
if the memory used by the boots is cleared or clobbered during first
time it's freed, otherwise second free doesn't notice any problem.

The 'wornarm_destroyed()' portion of this commit is sufficient to fix
this.  The other bits are things I tried before figuring out how to
reproduce it, plus zeroing out any object passed to dealloc_obj().
2023-03-20 17:05:02 -07:00
nhmall
de79240dea some comment spelling fixes 2023-03-16 22:27:01 -04:00
nhmall
ecf74d5308 some pline()-like function usage 2023-03-08 19:12:52 -05:00
PatR
3e6ea3faed fix #K3857 - hiding while trapped in a non-pit
sanity_check feedback which occurred after using locking magic to
set off a bear trap at the location of a monster hiding under an
object.

Trivial bit: a recent change made stunning via knockback only occur
when not already stunned but was still adding the current stun time
to the new stun time even though current stun is now always zero.

Several formatting bits included.
2023-02-03 10:45:59 -08:00
Pasi Kallinen
0722a5c2dd Fix punishment iron ball yanking hero on top of a monster
When attached iron ball was in a pit (or a pool) with a monster,
and your levitation ended, you were put on top of the monster.

Add a sanity check for hero over monster.
2023-02-03 08:51:48 +02:00
nhmall
8bbe9282aa add soundeffects hooks to core
Insert the calls to trigger a number of potential soundeffects
into the core.

If no additional soundlib support is integrated into the
build, then the Soundeffect macro (sndprocs.h) expands to nothing:

[#define Soundeffect(seid, vol)
]

If, however, at least one additional soundlib support is integrated
into the build, then the Soundeffect macro gets defined as this
in sndprocs.h:

[#define Soundeffect(seid, vol) \
    do {                                                              \
        if (!Deaf && soundprocs.sound_soundeffect                     \
            && ((soundprocs.sndcap & SNDCAP_SOUNDEFFECTS) != 0))      \
            (*soundprocs.sound_soundeffect)(emptystr, (seid), (vol)); \
    } while(0)
]

That macro definition checks for the hero not being Deaf; it checks
to ensure that the active soundlib interface has a non-null
sound_soundeffect() function pointer; and it checks to ensure
that the active soundlib interface has declared that it supports
soundeffects by setting the SNDCAP_SOUNDEFFECTS bit in its sndcap
entry. That just means that the interface routines are prepared to
accept and deal with the calls from the core, whether or not it
actually produces the desired soundeffect.
2023-01-20 14:20:08 -05:00
PatR
54aa047ec9 \#wizkill fix
When running #wizkill, if hero was swallowed and you killed the
engulfer and that dropped hero onto a level teleporter, the targetting
loop for selecting the next monster to kill kept going after changing
to another level.  Terminate #wizkill if killing something sends you
to a different level.

Not fixed, and an old bug, or variation of one:  the cursor got
positioned at the coordinates of your spot on the prior level even
though the part of the new level where you actually arrived was
displayed.

The hack.c and trap.c bits are just reformatting.
2022-12-01 15:36:40 -08:00
Pasi Kallinen
47c194fd56 Avoid segfault when null obj passed to water_damage 2022-12-01 13:29:52 +02:00
PatR
7099bf63de more #936 - water vs potions of acid
Pull request #936 took away the destruction of potions of acid ("acid
and water don't mix") if they survived water_damage().  Restore that
by forcing them to not survive.  Exception:  if they're greased and
pass the 50:50 chance of retaining the grease, they aren't destroyed.
2022-11-30 14:49:11 -08:00
Michael Meyer
263e48c6f7 Tell player when water damage removes grease
This was totally silent, which -- at least for me -- has led to quite a
few cases of believing my bag or cloak is still greased when it actually
wore off the last time I took a dip.  I think telling the player that
the grease has worn off would be helpful, and is consistent with other
types of water damage.

The message is printed even if you are blind, since that seems to be
true of all the other messages in water_damage().  I am not sure if that
makes complete sense (especially for ones like a scroll fading -- some
like water getting into a bag could be sensed by touch) but I didn't
change anything there.
2022-11-30 12:54:26 -08:00
nhmall
02a48aa8cf split g into multiple structures
The consolidation of global variables from scattered source
files into decl.c and declared in decl.h was begun in 3.7.0.
Their placement in common files was done for centralized
initialization and potential re-initialization during a
"play again" scenario.

It wasn't really necessary for all of them to be housed in a
single huge structure to meet the "play again" requirement,
and the single huge structure has been a little unwieldy when
it comes to maintenance.

Following this commit, instead of one single extremely large structure
named 'g' to house all of the relocated global variables, they
are distributed into several ga through gz.

To make things easy for the developer, each variable is placed
into the struct corresponding to the starting letter of the variable.
That way, no lookup is required in order to know which struct houses
a particular variable, it is a simple match to the starting letter
for all the centralized global variables.

A global variable named 'amulets', would be found in ga.
    ga.amulets
     ^ ^
A global varable named 'move', would be found in gm.
    gm.moves
     ^ ^
A global variable named 'val_for_n_or_more' would be found in gv.
    gv.val_for_n_or_more
     ^ ^
A global variable named 'youmonst' would be found in gy.
    gy.youmonst
     ^ ^
2022-11-29 21:53:21 -05:00
Michael Meyer
619781dbb8 Add 'mdistu' macro
Short for distu(mtmp->mx, mtmp->my) (i.e. the distance between the hero
and the specified monster), which is a very common use of distu().  The
idea is that this would be a convenient shorthand for it; I actually
thought it (or something very similar) existed already, but couldn't
find it when I tried to use it earlier.  Based on the number of uses of
fully-spelled-out 'distu(mtmp->mx, mtmp->my)' replaced in this commit
I'm guessing I just imagined it.
2022-11-18 23:42:47 -08:00
nhmall
99a93fe50b some C99 changes
Instead of using index() macro defined to strchr, use C99 strchr.
Instead of using rindex() macro defined to strrchr, use C99 strrchr.

If you want to try building on a platform that doesn't offer those
two functions, these are available:
    define NOT_C99       /* to make some non-C99 code available */
    define NEED_INDEX    /* to define a macro for index()  */
    define NEED_RINDX    /* to define a macro for rindex() */
2022-10-29 10:54:25 -04:00
PatR
61c61f8b04 dgn_bottom() fix
Use the level passed in instead of the hero's location when checking
the dungeon branch.

It probably doesn't make any difference, but use the argument that's
already being provided.
2022-09-22 23:16:19 -07:00
PatR
2d4c5a8e44 refine bottom of Gehennom check
In the quest branch, dbg_bottom() returns a barrier level rather
than actual bottom.  Do things the same way for the gehennom branch.
2022-09-22 16:47:37 -07:00
Michael Meyer
81285b661e Apply dest. limit to monster trap door usage
To prevent monsters from falling past the bottom level or into the
sanctum early, and to maintain consistency between monster and hero hole
usage.
2022-09-22 11:36:48 +03:00
Michael Meyer
9f5b362601 Refine attempt to clamp trap door fall destination
This should prevent anyone from exploiting falling into the sanctum (by
taking advantage of a trap door in a bones file from a differently
laid-out dungeon, as described in the previous commit) to bypass the
invocation, in addition to falling past the actual end of the dungeon.
2022-09-22 11:36:48 +03:00