v0.9.2b: added path validation and fixed FOW bugs with ally warp

This commit is contained in:
Evan Debenham 2021-03-16 17:46:54 -04:00
parent 59ffaa1b8c
commit b2fefa256f

View File

@ -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;
}