From cfedb7aaf2476bc9a52e538ee0ff20f005d6b248 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 4 Jan 2024 13:29:30 -0500 Subject: [PATCH] v2.3.0: fixed char swapping and ally warp working on immobile allies --- .../shatteredpixel/shatteredpixeldungeon/actors/Char.java | 6 ++++++ 1 file changed, 6 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 2eda0f44d..7d53ef94e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -208,6 +208,7 @@ public abstract class Char extends Actor { return true; } else if (c instanceof Hero && alignment == Alignment.ALLY + && !hasProp(this, Property.IMMOVABLE) && Dungeon.level.distance(pos, c.pos) <= 2*Dungeon.hero.pointsInTalent(Talent.ALLY_WARP)){ return true; } else { @@ -235,6 +236,11 @@ public abstract class Char extends Actor { int oldPos = pos; int newPos = c.pos; + //can't swap or ally warp if either char is immovable + if (hasProp(this, Property.IMMOVABLE) || hasProp(c, Property.IMMOVABLE)){ + return true; + } + //warp instantly with allies in this case if (c == Dungeon.hero && Dungeon.hero.hasTalent(Talent.ALLY_WARP)){ PathFinder.buildDistanceMap(c.pos, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, null));