From 77c5285f2fde1daaa65d742293e7e00dda7f6875 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 12 Jan 2022 16:30:37 -0500 Subject: [PATCH] v1.1.2: fixed rare edge-case crashes with levitation --- .../shatteredpixeldungeon/actors/buffs/Levitation.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Levitation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Levitation.java index fdf36a3fbe..00472c3428 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Levitation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Levitation.java @@ -22,8 +22,10 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -50,7 +52,10 @@ public boolean attachTo( Char target ) { public void detach() { target.flying = false; super.detach(); - Dungeon.level.occupyCell(target ); + //only press tiles if we're current in the game screen + if (ShatteredPixelDungeon.scene() instanceof GameScene) { + Dungeon.level.occupyCell(target ); + } } @Override