From d1d2d7d268d30bde28121224a76fd5eb434443e0 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 10 Feb 2026 13:35:34 -0500 Subject: [PATCH] v3.3.6: added a sync check to actor processing while iterating all --- .../shatteredpixeldungeon/actors/Actor.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 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 d7af5e333..1fa4b18a4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java @@ -252,15 +252,17 @@ public abstract class Actor implements Bundlable { if (!interrupted && !Game.switchingScene()) { float earliest = Float.MAX_VALUE; - for (Actor actor : all) { - - //some actors will always go before others if time is equal. - if (actor.time < earliest || - actor.time == earliest && (current == null || actor.actPriority > current.actPriority)) { - earliest = actor.time; - current = actor; + synchronized (Actor.class) { + for (Actor actor : all) { + + //some actors will always go before others if time is equal. + if (actor.time < earliest || + actor.time == earliest && (current == null || actor.actPriority > current.actPriority)) { + earliest = actor.time; + current = actor; + } + } - } }