From b78f7345b9b8495c00529f61853fa02e37121211 Mon Sep 17 00:00:00 2001 From: Corwin Date: Tue, 29 Aug 2023 22:32:03 +0100 Subject: [PATCH] replace existing animation for pushed entity --- .../the-dungeon-puzzlers-lament/src/game/simulation/entity.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs b/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs index 3a96d0de..c45ca646 100644 --- a/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs +++ b/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs @@ -51,6 +51,8 @@ fn remove_move_animation_for_entity( if let Some(existing_animation) = animations.iter().position(|x| { if let AnimationInstruction::Move(entity, _, _) = x { *entity == entity_key + } else if let AnimationInstruction::FakeOutMove(entity, _, _, _) = x { + *entity == entity_key } else { false } @@ -188,6 +190,7 @@ impl EntityMap { MoveAttemptResolution::AttemptPush => { let depth = push_depth - 1; if depth >= 0 { + remove_move_animation_for_entity(animations, other_entity_key); let (can_move_result, action_result) = self.attempt_move_in_direction( map, animations,