v3.0.0: fixed piranhas not caring if terrain wasn't passable

This commit is contained in:
Evan Debenham
2025-01-23 14:00:08 -05:00
parent fe845743b9
commit e61064aa1e
@@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.RatSkull; import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.RatSkull;
import com.shatteredpixel.shatteredpixeldungeon.sprites.PiranhaSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.PiranhaSprite;
import com.watabou.utils.BArray;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import com.watabou.utils.Random; import com.watabou.utils.Random;
@@ -135,7 +136,7 @@ public class Piranha extends Mob {
return false; 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) { if (step != -1) {
move( step ); move( step );
return true; return true;
@@ -146,7 +147,7 @@ public class Piranha extends Mob {
@Override @Override
protected boolean getFurther( int target ) { 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) { if (step != -1) {
move( step ); move( step );
return true; return true;