v2.2.1: added some safety checks to crystal guardians and newborn fire

This commit is contained in:
Evan Debenham
2023-10-19 17:03:23 -04:00
parent 26ca3549aa
commit ad669880fc
2 changed files with 17 additions and 15 deletions
@@ -201,7 +201,7 @@ public class CrystalGuardian extends Mob{
@Override
public boolean[] modifyPassable(boolean[] passable) {
//if we are hunting, we can stomp through crystals, but prefer not to
if (state == HUNTING){
if (state == HUNTING && target != -1){
PathFinder.buildDistanceMap(target, passable);
if (PathFinder.distance[pos] > 2*Dungeon.level.distance(pos, target)) {
@@ -327,6 +327,7 @@ public abstract class Elemental extends Mob {
@Override
protected void zap() {
if (targetingPos != -1) {
spend(1f);
Invisibility.dispel(this);
@@ -347,6 +348,7 @@ public abstract class Elemental extends Mob {
}
}
Sample.INSTANCE.play(Assets.Sounds.BURNING);
}
targetingPos = -1;
rangedCooldown = Random.NormalIntRange( 3, 5 );