From b2fefa256fe3218ad16a572258fceda683917bb1 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 16 Mar 2021 17:46:54 -0400 Subject: [PATCH] v0.9.2b: added path validation and fixed FOW bugs with ally warp --- .../shatteredpixel/shatteredpixeldungeon/actors/Char.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index 944992dfa..320842b27 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -84,7 +84,9 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.GrimTrap; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; +import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundlable; @@ -191,9 +193,14 @@ public abstract class Char extends Actor { //warp instantly with allies in this case if (Dungeon.hero.hasTalent(Talent.ALLY_WARP)){ + PathFinder.buildDistanceMap(c.pos, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, null)); + if (PathFinder.distance[pos] == Integer.MAX_VALUE){ + return true; + } ScrollOfTeleportation.appear(this, Dungeon.hero.pos); ScrollOfTeleportation.appear(Dungeon.hero, curPos); Dungeon.observe(); + GameScene.updateFog(); return true; }