From e61064aa1ee7190a15ca057d8115bfcd04da7ef9 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 23 Jan 2025 14:00:08 -0500 Subject: [PATCH] v3.0.0: fixed piranhas not caring if terrain wasn't passable --- .../shatteredpixeldungeon/actors/mobs/Piranha.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java index 4fd72ec52..a6d409f9d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java @@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.RatSkull; import com.shatteredpixel.shatteredpixeldungeon.sprites.PiranhaSprite; +import com.watabou.utils.BArray; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -135,7 +136,7 @@ public class Piranha extends Mob { return false; } - int step = Dungeon.findStep( this, target, Dungeon.level.water, fieldOfView, true ); + int step = Dungeon.findStep( this, target, BArray.and(Dungeon.level.water, Dungeon.level.passable, null), fieldOfView, true ); if (step != -1) { move( step ); return true; @@ -146,7 +147,7 @@ public class Piranha extends Mob { @Override protected boolean getFurther( int target ) { - int step = Dungeon.flee( this, target, Dungeon.level.water, fieldOfView, true ); + int step = Dungeon.flee( this, target, BArray.and(Dungeon.level.water, Dungeon.level.passable, null), fieldOfView, true ); if (step != -1) { move( step ); return true;