v2.3.0: fixed cases where pushing could fail to apply and freeze

This commit is contained in:
Evan Debenham
2024-01-15 22:48:22 -05:00
parent 6a414c747b
commit f6f6ea4cd1
@@ -64,17 +64,19 @@ public class Pushing extends Actor {
@Override @Override
protected boolean act() { protected boolean act() {
if (sprite != null) { Actor.remove( Pushing.this );
if (sprite != null && sprite.parent != null) {
if (Dungeon.level.heroFOV[from] || Dungeon.level.heroFOV[to]){ if (Dungeon.level.heroFOV[from] || Dungeon.level.heroFOV[to]){
sprite.visible = true; sprite.visible = true;
} }
if (effect == null) { if (effect == null) {
new Effect(); new Effect();
} }
} else {
return true;
} }
Actor.remove( Pushing.this );
//so that all pushing effects at the same time go simultaneously //so that all pushing effects at the same time go simultaneously
for ( Actor actor : Actor.all() ){ for ( Actor actor : Actor.all() ){
if (actor instanceof Pushing && actor.cooldown() == 0) if (actor instanceof Pushing && actor.cooldown() == 0)