v2.0.0: rippers now still leap if their target is blocked by terrain

This commit is contained in:
Evan Debenham
2022-11-14 15:13:29 -05:00
parent dd5b7592f9
commit 5d707c3eea

View File

@@ -137,14 +137,15 @@ public class RipperDemon extends Mob {
if (leapPos != -1){
leapCooldown = Random.NormalIntRange(2, 4);
Ballistica b = new Ballistica(pos, leapPos, Ballistica.STOP_TARGET | Ballistica.STOP_SOLID);
//check if leap pos is not obstructed by terrain
if (rooted || b.collisionPos != leapPos){
if (rooted){
leapPos = -1;
return true;
}
Ballistica b = new Ballistica(pos, leapPos, Ballistica.STOP_TARGET | Ballistica.STOP_SOLID);
leapPos = b.collisionPos;
final Char leapVictim = Actor.findChar(leapPos);
final int endPos;