known bear trap forgotton by player polymorphed into a flyer

The original report stated:

     "I located a bear trap as a human and just ignored it
     for the time. I polymporphed into a Vampire Lord, then
     went to #untrap the bear trap.  On the first attempt,
     I stood beside the trap and attempted to #untrap.  I
     received the 'Whoops!' message and automatically moved
     onto the trap square as a result. The bear trap vanished!
     I obviously wasn't trapped since I'm polymorphed into a
     flying monster, but the trap glyph was no longer present.
     The glyph looked like regular floor - as if I had
     untrapped the bear trap and taken the trap with me."

The trap was actually still there but became hidden intentionally
for other valid scenarios, but was an unintended side-effect for
this scenario.

Fix it by failing the #untrap operation for a Flyer earlier on,
and in a more benign manner, since the Flyer ultimately doesn't
end up in the trap anyway.  You'll still get the "Whoops!",
followed by a message, but that's as far as the "failed" #untrap
attempt will go under the circumstances.
This commit is contained in:
nhmall
2018-09-23 11:16:09 -04:00
parent 76bffe5ba4
commit 2813e42b22
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -136,6 +136,9 @@ gremlins seemed impervious to Sunsword's light yet a flash from a camera
when objects migrate (fall down stairs) and invisible hero (w/o see invisible, when objects migrate (fall down stairs) and invisible hero (w/o see invisible,
no-autopickup) descends, stairs get shown instead of object(s) on them no-autopickup) descends, stairs get shown instead of object(s) on them
drum of earthquake was causing deafness but oddly enough only when used up drum of earthquake was causing deafness but oddly enough only when used up
known bear trap was being forgotten about by a player polymorphed into a
flying monster if the player unsuccessfully tried to #untrap it and
moved onto the trap square as a result
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
+10
View File
@@ -3991,6 +3991,16 @@ boolean force_failure;
} }
} else if (under_u) { } else if (under_u) {
dotrap(ttmp, 0); dotrap(ttmp, 0);
} else if (ttype == BEAR_TRAP && (Levitation || Flying)) {
/* There was a report of oddities of the trap
vanishing from view due to tseen being cleared
(which was deliberate to work around a check_here()
issue). Since you won't actually end up in the trap
during the #untrap operation anyway due to
Levitation and Flying checks further along,
just avoid the whole "vanishing trap" scenario
by failing the #untrap operation right here. */
You("couldn't reach it from your vantage point.");
} else { } else {
move_into_trap(ttmp); move_into_trap(ttmp);
} }