00-Evan / shattered-pixel-dungeon

Shattered Pixel Dungeon is an open-source traditional roguelike dungeon crawler with randomized levels and enemies, and hundreds of items to collect and use. It's based on the source code of Pixel Dungeon, by Watabou.
https://shatteredpixel.com/shatteredpd/
GNU General Public License v3.0
4.77k stars 1.12k forks source link

You can still lose the pickaxe in the mine with a reclaimed disarming trap #1884

Open chorby-short opened 2 weeks ago

chorby-short commented 2 weeks ago

Not sure if you care, but considering you took provisions to prevent it being transmuted or dropped, thought you might want to know.

00-Evan commented 1 week ago

This turned out to be very specific!

Disarming traps already have a little internal logic that prevents them from teleporting the hero's weapon too close or too far, and that check includes only treating pathable terrain from the current hero position as valid. However, if there is no valid walkable position (e.g. if the hero is in a tiny enclosed room) then the trap will simply give up and use a purely random position. Fix here is to just have the trap's effect fail entirely if there's no valid pathable position.