v3.0.0: fixed char sprite states not being removed in some cases

This commit is contained in:
Evan Debenham
2025-01-09 11:51:49 -05:00
parent fdb77ca910
commit db70d8fa98
4 changed files with 9 additions and 9 deletions

View File

@@ -307,7 +307,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
public void die() { public void die() {
sleeping = false; sleeping = false;
remove( State.PARALYSED ); processStateRemoval( State.PARALYSED );
play( die ); play( die );
hideEmo(); hideEmo();
@@ -373,8 +373,8 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
add(State.AURA); add(State.AURA);
auraColor = color; auraColor = color;
} }
private synchronized void processStateAddition( State state ) { protected synchronized void processStateAddition( State state ) {
switch (state) { switch (state) {
case BURNING: case BURNING:
if (burning != null) burning.on = false; if (burning != null) burning.on = false;
@@ -468,7 +468,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
remove(State.AURA); remove(State.AURA);
} }
private synchronized void processStateRemoval( State state ) { protected synchronized void processStateRemoval( State state ) {
switch (state) { switch (state) {
case BURNING: case BURNING:
if (burning != null) { if (burning != null) {
@@ -717,7 +717,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
hideEmo(); hideEmo();
for( State s : State.values()){ for( State s : State.values()){
remove(s); processStateRemoval(s);
} }
if (health != null){ if (health != null){

View File

@@ -55,7 +55,7 @@ public class GhoulSprite extends MobSprite {
public void crumple(){ public void crumple(){
hideEmo(); hideEmo();
remove(State.PARALYSED); processStateRemoval(State.PARALYSED);
play(crumple); play(crumple);
} }

View File

@@ -62,7 +62,7 @@ public class NewbornElementalSprite extends MobSprite{
@Override @Override
public void die() { public void die() {
super.die(); super.die();
remove( CharSprite.State.BURNING ); processStateRemoval( CharSprite.State.BURNING );
} }
@Override @Override

View File

@@ -60,8 +60,8 @@ public class WandmakerSprite extends MobSprite {
@Override @Override
public void die() { public void die() {
super.die(); super.die();
remove(State.SHIELDED); processStateRemoval(State.SHIELDED);
emitter().start( ElmoParticle.FACTORY, 0.03f, 60 ); emitter().start( ElmoParticle.FACTORY, 0.03f, 60 );
if (visible) { if (visible) {