From 8d3226ba5a873054273d18e7b2cd4efbf364b6f7 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 15 Jun 2023 13:19:07 -0400 Subject: [PATCH] v2.1.2: fixed retreating errors for large chars caused by 2.1.1 --- .../com/shatteredpixel/shatteredpixeldungeon/Dungeon.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index 043b5d8fb..2903c7cba 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -958,6 +958,10 @@ public class Dungeon { } public static boolean[] findPassable(Char ch, boolean[] pass, boolean[] vis, boolean chars){ + return findPassable(ch, pass, vis, chars, chars); + } + + public static boolean[] findPassable(Char ch, boolean[] pass, boolean[] vis, boolean chars, boolean considerLarge){ setupPassable(); if (ch.flying || ch.buff( Amok.class ) != null) { BArray.or( pass, Dungeon.level.avoid, passable ); @@ -965,7 +969,7 @@ public class Dungeon { System.arraycopy( pass, 0, passable, 0, Dungeon.level.length() ); } - if (chars && Char.hasProp(ch, Char.Property.LARGE)){ + if (considerLarge && Char.hasProp(ch, Char.Property.LARGE)){ BArray.and( passable, Dungeon.level.openSpace, passable ); } @@ -998,7 +1002,7 @@ public class Dungeon { public static int flee( Char ch, int from, boolean[] pass, boolean[] visible, boolean chars ) { //only consider chars impassable if our retreat path runs into them - boolean[] passable = findPassable(ch, pass, visible, false); + boolean[] passable = findPassable(ch, pass, visible, false, true); passable[ch.pos] = true; int step = PathFinder.getStepBack( ch.pos, from, passable );