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

View File

@@ -64,17 +64,19 @@ public class Pushing extends Actor {
@Override
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]){
sprite.visible = true;
}
if (effect == null) {
new Effect();
}
} else {
return true;
}
Actor.remove( Pushing.this );
//so that all pushing effects at the same time go simultaneously
for ( Actor actor : Actor.all() ){
if (actor instanceof Pushing && actor.cooldown() == 0)