fix #K4042 - visible but unreachable teleport trap

If a monster fled from the hero by intentionally jumping into a vault
teleporter located in a niche which was still hidden and the hero
saw it happen, the trap would be mapped but the niche would remain as
a secret corridor spot.  The hero couldn't move onto the trap until
searching or wall kicking or other map disclosing activity converted
the spot into regular corridor.

Trap doors in hidden niches did already change the secret corridor
into normal corridor to unhide the trap's spot, but only if the hero
saw it happen.  Now the terrain change occurs even if hero doesn't
see it; only mapping the trap depends on that.

While testing the fix, I noticed that a monster jumping onto a vault
teleporter was teleporting randomly rather than being sent to the
vault, unlike when triggering such a trap by accident.  The code has
changed for 3.7 but this bug was already present in earlier versions.
This commit is contained in:
PatR
2023-12-02 15:05:45 -08:00
parent 0c03b9bea6
commit 6c38bfeba2
2 changed files with 56 additions and 30 deletions

View File

@@ -1305,6 +1305,10 @@ alchemy may affect only a portion of the dipped potions if a large
monster kills can no longer deathdrop comestibles (other than the
monster's corpse) unless the monster collects food or
generates with food
if a monster fled from hero by intentionally jumping into a vault teleporter,
it would teleport randomly instead of into the vault, and if the
teleport trap's niche wasn't mapped yet, the trap would become mapped
but the spot would remain a secret corridor and not become accessible
Fixes to 3.7.0-x General Problems Exposed Via git Repository