v0.9.0: fixed some crash bugs

This commit is contained in:
Evan Debenham 2020-09-23 13:13:54 -04:00
parent 6f7cc49431
commit 578c307b1f
3 changed files with 7 additions and 3 deletions

View File

@ -150,7 +150,7 @@ public class Thief extends Mob {
GLog.w( Messages.get(Thief.class, "stole", toSteal.name()) );
if (!toSteal.stackable) {
Dungeon.quickslot.convertToPlaceholder(item);
Dungeon.quickslot.convertToPlaceholder(toSteal);
}
Item.updateQuickslot();

View File

@ -72,6 +72,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.particles.Emitter;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
import com.watabou.utils.Reflection;
@ -375,7 +376,8 @@ public class Potion extends Item {
Hero hero = Dungeon.hero;
if (hero.hasTalent(Talent.TEST_SUBJECT)) {
hero.HP = Math.min(hero.HP + 1 + (2 * hero.pointsInTalent(Talent.TEST_SUBJECT)), hero.HT);
hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), hero.pointsInTalent(Talent.TEST_SUBJECT));
Emitter e = hero.sprite.emitter();
if (e != null) e.burst(Speck.factory(Speck.HEALING), hero.pointsInTalent(Talent.TEST_SUBJECT));
}
}
return super.identify();

View File

@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.particles.Emitter;
public class ScrollOfRecharging extends Scroll {
@ -55,7 +56,8 @@ public class ScrollOfRecharging extends Scroll {
}
public static void charge( Char user ) {
user.sprite.centerEmitter().burst( EnergyParticle.FACTORY, 15 );
Emitter e = user.sprite.centerEmitter();
if (e != null) e.burst( EnergyParticle.FACTORY, 15 );
}
@Override