v2.2.1: added some safety checks to crystal guardians and newborn fire
This commit is contained in:
+1
-1
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user