From 1757c2ae7dd776afaa473ab5cc3e5ff41be98988 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 22 Jun 2017 17:23:59 -0400 Subject: [PATCH] v0.6.1: improved actor thread interrupt handling --- .../shatteredpixeldungeon/actors/Actor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java index e229ced3e..6d3640413 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java @@ -231,13 +231,20 @@ public abstract class Actor implements Bundlable { } if (!doNext){ - interrupted = false; - synchronized (Thread.currentThread()) { + + interrupted = interrupted || Thread.interrupted(); + + if (interrupted){ + current = null; + interrupted = false; + } + synchronized (GameScene.class){ //signals to the gamescene that actor processing is finished for now GameScene.class.notify(); } + try { Thread.currentThread().wait(); } catch (InterruptedException e) {