v1.1.1: added a couple safety checks against crashes

This commit is contained in:
Evan Debenham 2021-12-20 16:06:24 -05:00
parent 5df083b21f
commit c61250c125
4 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -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));

View File

@ -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();

View File

@ -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();