diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java index c9cb3ebbd..c6c9c019a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java @@ -76,9 +76,15 @@ public class Berserk extends Buff { @Override public boolean act() { if (berserking()){ - WarriorShield buff = target.buff(WarriorShield.class); + ShieldBuff buff = target.buff(WarriorShield.class); if (target.HP <= 0) { - buff.absorbDamage(1 + (int)Math.ceil(target.shielding() * 0.1f)); + if (buff != null && buff.shielding() > 0) { + buff.absorbDamage(1 + (int)Math.ceil(target.shielding() * 0.1f)); + } else { + //if there is no shield buff, or it is empty, then try to remove from other shielding buffs + buff = target.buff(ShieldBuff.class); + if (buff != null) buff.absorbDamage(1 + (int)Math.ceil(target.shielding() * 0.1f)); + } if (target.shielding() <= 0) { target.die(this); if (!target.isAlive()) Dungeon.fail(this.getClass()); @@ -87,7 +93,7 @@ public class Berserk extends Buff { state = State.RECOVERING; levelRecovery = LEVEL_RECOVER_START; BuffIndicator.refreshHero(); - buff.absorbDamage(buff.shielding()); + if (buff != null) buff.absorbDamage(buff.shielding()); power = 0f; } } else if (state == State.NORMAL) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java index 6248b9172..263525480 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java @@ -78,7 +78,6 @@ public class WndRanking extends WndTabbed { } } }; - thread.start(); busy = Icons.BUSY.get(); busy.origin.set( busy.width / 2, busy.height / 2 ); @@ -86,6 +85,8 @@ public class WndRanking extends WndTabbed { busy.x = (WIDTH - busy.width) / 2; busy.y = (HEIGHT - busy.height) / 2; add( busy ); + + thread.start(); } @Override