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.ScrollOfMagicMapping;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
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.wands.WandOfMagicMissile;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Dagger;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Dagger;
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class ScrollOfDivination extends ExoticScroll {
|
||||||
total --;
|
total --;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (total == 0){
|
if (left == 4){
|
||||||
GLog.n( Messages.get(this, "nothing_left") );
|
GLog.n( Messages.get(this, "nothing_left") );
|
||||||
} else {
|
} else {
|
||||||
GameScene.show(new WndDivination(IDed));
|
GameScene.show(new WndDivination(IDed));
|
||||||
|
|
|
@ -93,6 +93,9 @@ public abstract class TippedDart extends Dart {
|
||||||
} else if (index == 1){
|
} else if (index == 1){
|
||||||
detach(hero.belongings.backpack);
|
detach(hero.belongings.backpack);
|
||||||
if (!new Dart().collect()) Dungeon.level.drop(new Dart(), hero.pos).sprite.drop();
|
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.spend( 1f );
|
||||||
hero.busy();
|
hero.busy();
|
||||||
|
|
|
@ -627,7 +627,7 @@ public class GameScene extends PixelScene {
|
||||||
@Override
|
@Override
|
||||||
public synchronized void onPause() {
|
public synchronized void onPause() {
|
||||||
try {
|
try {
|
||||||
if (!Dungeon.hero.ready) waitForActorThread(500, false);
|
if (Dungeon.hero != null && !Dungeon.hero.ready) waitForActorThread(500, false);
|
||||||
Dungeon.saveAll();
|
Dungeon.saveAll();
|
||||||
Badges.saveGlobal();
|
Badges.saveGlobal();
|
||||||
Journal.saveGlobal();
|
Journal.saveGlobal();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user