v0.9.1b: added various safety checks to prevent crashes
This commit is contained in:
@@ -570,7 +570,8 @@ public class Item implements Bundlable {
|
||||
@Override
|
||||
public void call() {
|
||||
curUser = user;
|
||||
Item.this.detach(user.belongings.backpack).onThrow(cell);
|
||||
Item i = Item.this.detach(user.belongings.backpack);
|
||||
if (i != null) i.onThrow(cell);
|
||||
if (curUser.hasTalent(Talent.IMPROVISED_PROJECTILES)
|
||||
&& !(Item.this instanceof MissileWeapon)
|
||||
&& curUser.buff(Talent.ImprovisedProjectileCooldown.class) == null){
|
||||
|
||||
+13
-2
@@ -22,6 +22,7 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
|
||||
public class GhoulSprite extends MobSprite {
|
||||
@@ -44,10 +45,10 @@ public class GhoulSprite extends MobSprite {
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 0, 8, 9 );
|
||||
|
||||
crumple = new Animation( 15, false);
|
||||
crumple = new Animation( 1, false);
|
||||
crumple.frames( frames, 0, 10, 11, 12 );
|
||||
|
||||
die = new Animation( 15, false );
|
||||
die = new Animation( 1, false );
|
||||
die.frames( frames, 0, 10, 11, 12, 13 );
|
||||
|
||||
play( idle );
|
||||
@@ -58,6 +59,16 @@ public class GhoulSprite extends MobSprite {
|
||||
play(crumple);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void move(int from, int to) {
|
||||
if (parent == null){
|
||||
//fixme this happens rarely, likely due to ghoul like link?
|
||||
Game.reportException(new RuntimeException("ghoul sprite tried to move with null parent! ghoul HP: " + ch.HP));
|
||||
return;
|
||||
}
|
||||
super.move(from, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
if (curAnim == crumple){
|
||||
|
||||
Reference in New Issue
Block a user