v3.1.0: added a few crash safety checks
This commit is contained in:
@@ -586,7 +586,9 @@ public abstract class Char extends Actor {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
enemy.sprite.showStatus( CharSprite.NEUTRAL, enemy.defenseVerb() );
|
if (enemy.sprite != null){
|
||||||
|
enemy.sprite.showStatus( CharSprite.NEUTRAL, enemy.defenseVerb() );
|
||||||
|
}
|
||||||
if (visibleFight) {
|
if (visibleFight) {
|
||||||
//TODO enemy.defenseSound? currently miss plays for monks/crab even when they parry
|
//TODO enemy.defenseSound? currently miss plays for monks/crab even when they parry
|
||||||
Sample.INSTANCE.play(Assets.Sounds.MISS);
|
Sample.INSTANCE.play(Assets.Sounds.MISS);
|
||||||
|
|||||||
+2
-2
@@ -37,7 +37,7 @@ public class EnhancedRings extends FlavourBuff {
|
|||||||
@Override
|
@Override
|
||||||
public boolean attachTo(Char target) {
|
public boolean attachTo(Char target) {
|
||||||
if (super.attachTo(target)){
|
if (super.attachTo(target)){
|
||||||
if (target instanceof Hero) ((Hero) target).updateHT(false);
|
if (target == Dungeon.hero) ((Hero) target).updateHT(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -46,7 +46,7 @@ public class EnhancedRings extends FlavourBuff {
|
|||||||
@Override
|
@Override
|
||||||
public void detach() {
|
public void detach() {
|
||||||
super.detach();
|
super.detach();
|
||||||
if (target instanceof Hero) ((Hero) target).updateHT(false);
|
if (target == Dungeon.hero) ((Hero) target).updateHT(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class MobSprite extends CharSprite {
|
|||||||
health.killAndErase();
|
health.killAndErase();
|
||||||
}
|
}
|
||||||
|
|
||||||
parent.add( new ScaleTweener( this, new PointF( 0, 0 ), FALL_TIME ) {
|
if (parent != null) parent.add( new ScaleTweener( this, new PointF( 0, 0 ), FALL_TIME ) {
|
||||||
@Override
|
@Override
|
||||||
protected void onComplete() {
|
protected void onComplete() {
|
||||||
MobSprite.this.killAndErase();
|
MobSprite.this.killAndErase();
|
||||||
|
|||||||
Reference in New Issue
Block a user