From 3fe42591d99f31a7ee1f26e0d19fd68b72b931ec Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 7 Feb 2021 13:54:40 -0500 Subject: [PATCH] v0.9.2: fixed bugs with previously changed gamescene functionality --- .../scenes/GameScene.java | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 77e1529df..bbc8f444e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -554,20 +554,22 @@ public class GameScene extends PixelScene { } } - public synchronized boolean waitForActorThread(int msToWait ){ - if (actorThread != null && actorThread.isAlive()){ - return true; - } - synchronized (actorThread) { - actorThread.interrupt(); - } - try { - GameScene.class.wait(msToWait); - } catch (InterruptedException e) { - ShatteredPixelDungeon.reportException(e); - } - synchronized (actorThread) { - return Actor.processing(); + public boolean waitForActorThread(int msToWait ){ + synchronized (GameScene.class) { + if (actorThread == null || !actorThread.isAlive()) { + return true; + } + synchronized (actorThread) { + actorThread.interrupt(); + } + try { + GameScene.class.wait(msToWait); + } catch (InterruptedException e) { + ShatteredPixelDungeon.reportException(e); + } + synchronized (actorThread) { + return !Actor.processing(); + } } }