From 2813e42b22eef20b33ce2acd95875e11f54b810c Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 23 Sep 2018 11:16:09 -0400 Subject: [PATCH] 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. --- doc/fixes36.2 | 3 +++ src/trap.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index a76f1bb3b..c02837500 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -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, 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 +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 diff --git a/src/trap.c b/src/trap.c index f7d1d0bc9..99554c326 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3991,6 +3991,16 @@ boolean force_failure; } } else if (under_u) { 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 { move_into_trap(ttmp); }