v0.7.4: added some safety checks
This commit is contained in:
parent
d6cf71e790
commit
ed45c37e0a
|
@ -91,6 +91,7 @@ public class Piranha extends Mob {
|
||||||
public int defenseSkill( Char enemy ) {
|
public int defenseSkill( Char enemy ) {
|
||||||
enemySeen = state != SLEEPING
|
enemySeen = state != SLEEPING
|
||||||
&& this.enemy != null
|
&& this.enemy != null
|
||||||
|
&& fieldOfView != null
|
||||||
&& fieldOfView[this.enemy.pos]
|
&& fieldOfView[this.enemy.pos]
|
||||||
&& this.enemy.invisible == 0;
|
&& this.enemy.invisible == 0;
|
||||||
return super.defenseSkill( enemy );
|
return super.defenseSkill( enemy );
|
||||||
|
|
|
@ -75,8 +75,7 @@ public class WardSprite extends MobSprite {
|
||||||
|
|
||||||
idle = tierIdles[tier];
|
idle = tierIdles[tier];
|
||||||
run = idle.clone();
|
run = idle.clone();
|
||||||
//zap = idle.clone();
|
attack = idle.clone();
|
||||||
//attack = idle.clone();
|
|
||||||
die = idle.clone();
|
die = idle.clone();
|
||||||
|
|
||||||
//always render first
|
//always render first
|
||||||
|
@ -100,7 +99,7 @@ public class WardSprite extends MobSprite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private float baseY;
|
private float baseY = Float.NaN;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void place(int cell) {
|
public void place(int cell) {
|
||||||
|
@ -113,6 +112,7 @@ public class WardSprite extends MobSprite {
|
||||||
super.update();
|
super.update();
|
||||||
//if tier is greater than 3
|
//if tier is greater than 3
|
||||||
if (perspectiveRaise >= 6 / 16f){
|
if (perspectiveRaise >= 6 / 16f){
|
||||||
|
if (Float.isNaN(baseY)) baseY = y;
|
||||||
y = baseY + (float) Math.sin(Game.timeTotal);
|
y = baseY + (float) Math.sin(Game.timeTotal);
|
||||||
shadowOffset = 0.25f - 0.8f*(float) Math.sin(Game.timeTotal);
|
shadowOffset = 0.25f - 0.8f*(float) Math.sin(Game.timeTotal);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user