v1.1.1: added a couple safety checks against crashes
This commit is contained in:
parent
5df083b21f
commit
c61250c125
|
@ -55,6 +55,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfLullaby;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfDivination;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfMagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Dagger;
|
||||
|
|
|
@ -111,7 +111,7 @@ public class ScrollOfDivination extends ExoticScroll {
|
|||
total --;
|
||||
}
|
||||
|
||||
if (total == 0){
|
||||
if (left == 4){
|
||||
GLog.n( Messages.get(this, "nothing_left") );
|
||||
} else {
|
||||
GameScene.show(new WndDivination(IDed));
|
||||
|
|
|
@ -93,6 +93,9 @@ public abstract class TippedDart extends Dart {
|
|||
} else if (index == 1){
|
||||
detach(hero.belongings.backpack);
|
||||
if (!new Dart().collect()) Dungeon.level.drop(new Dart(), hero.pos).sprite.drop();
|
||||
|
||||
//reset durability if there are darts left in the stack
|
||||
durability = MAX_DURABILITY;
|
||||
|
||||
hero.spend( 1f );
|
||||
hero.busy();
|
||||
|
|
|
@ -627,7 +627,7 @@ public class GameScene extends PixelScene {
|
|||
@Override
|
||||
public synchronized void onPause() {
|
||||
try {
|
||||
if (!Dungeon.hero.ready) waitForActorThread(500, false);
|
||||
if (Dungeon.hero != null && !Dungeon.hero.ready) waitForActorThread(500, false);
|
||||
Dungeon.saveAll();
|
||||
Badges.saveGlobal();
|
||||
Journal.saveGlobal();
|
||||
|
|
Loading…
Reference in New Issue
Block a user