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
|
@Override
|
||||||
public boolean[] modifyPassable(boolean[] passable) {
|
public boolean[] modifyPassable(boolean[] passable) {
|
||||||
//if we are hunting, we can stomp through crystals, but prefer not to
|
//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);
|
PathFinder.buildDistanceMap(target, passable);
|
||||||
|
|
||||||
if (PathFinder.distance[pos] > 2*Dungeon.level.distance(pos, target)) {
|
if (PathFinder.distance[pos] > 2*Dungeon.level.distance(pos, target)) {
|
||||||
|
|||||||
@@ -327,6 +327,7 @@ public abstract class Elemental extends Mob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void zap() {
|
protected void zap() {
|
||||||
|
if (targetingPos != -1) {
|
||||||
spend(1f);
|
spend(1f);
|
||||||
|
|
||||||
Invisibility.dispel(this);
|
Invisibility.dispel(this);
|
||||||
@@ -347,6 +348,7 @@ public abstract class Elemental extends Mob {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Sample.INSTANCE.play(Assets.Sounds.BURNING);
|
Sample.INSTANCE.play(Assets.Sounds.BURNING);
|
||||||
|
}
|
||||||
|
|
||||||
targetingPos = -1;
|
targetingPos = -1;
|
||||||
rangedCooldown = Random.NormalIntRange( 3, 5 );
|
rangedCooldown = Random.NormalIntRange( 3, 5 );
|
||||||
|
|||||||
Reference in New Issue
Block a user