From e33eee7d11a982b8bfaa217fba194429b1ce7b61 Mon Sep 17 00:00:00 2001 From: Corwin Date: Sun, 27 Aug 2023 17:27:43 +0100 Subject: [PATCH] fix mistakes copy over --- .../src/game/simulation/entity.rs | 13 +++++++++++++ 1 file changed, 13 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 a4ec2bf9..e7be632e 100644 --- a/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs +++ b/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs @@ -185,10 +185,19 @@ impl EntityMap { }; if can_move { + if let Some(e) = self.map.get_mut(entity_to_update_key) { + e.location = desired_location; + } let Some(entity_to_update) = self.map.get(entity_to_update_key) else { continue; }; + animations.push(AnimationInstruction::Move( + entity_to_update_key, + desired_location, + entity_to_update.move_effect(), + )); + let overlap_resolutions: Vec<_> = self .whats_at(desired_location) .filter(|(k, _)| *k != entity_to_update_key) @@ -569,6 +578,10 @@ impl Entity { } } + fn move_effect(&self) -> Option { + None + } + fn kill_sound_effect(&self) -> Option { match self.holding() { Some(EntityType::Item(Item::Sword)) => Some(SoundEffect::SwordKill),