v3.1.0: adjusted logic for applying/removing paralysed state

fixes bugs where sprites might stay visually paralysed for a frame
This commit is contained in:
Evan Debenham
2025-03-24 13:31:55 -04:00
parent f593824f9c
commit abd6b494f2
@@ -361,11 +361,16 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
private final HashSet<State> stateAdditions = new HashSet<>(); private final HashSet<State> stateAdditions = new HashSet<>();
public void add( State state ) { public void add( State state ) {
//instant as it just changes an animation property that will get read later
if (state == State.PARALYSED){
paused = true;
} else {
synchronized (State.class) { synchronized (State.class) {
stateRemovals.remove(state); stateRemovals.remove(state);
stateAdditions.add(state); stateAdditions.add(state);
} }
} }
}
private int auraColor = 0; private int auraColor = 0;
@@ -460,11 +465,16 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
private final HashSet<State> stateRemovals = new HashSet<>(); private final HashSet<State> stateRemovals = new HashSet<>();
public void remove( State state ) { public void remove( State state ) {
//instant as it just changes an animation property that will get read later
if (state == State.PARALYSED){
paused = false;
} else {
synchronized (State.class) { synchronized (State.class) {
stateAdditions.remove(state); stateAdditions.remove(state);
stateRemovals.add(state); stateRemovals.add(state);
} }
} }
}
public void clearAura(){ public void clearAura(){
remove(State.AURA); remove(State.AURA);