fix mistakes copy over

This commit is contained in:
Corwin 2023-08-27 17:27:43 +01:00
parent b9e6e09fe1
commit e33eee7d11
No known key found for this signature in database

View file

@ -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<SoundEffect> {
None
}
fn kill_sound_effect(&self) -> Option<SoundEffect> {
match self.holding() {
Some(EntityType::Item(Item::Sword)) => Some(SoundEffect::SwordKill),