diff options
Diffstat (limited to 'src/systems/fight.rs')
| -rw-r--r-- | src/systems/fight.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/systems/fight.rs b/src/systems/fight.rs index 88305e2..00aeb3e 100644 --- a/src/systems/fight.rs +++ b/src/systems/fight.rs @@ -13,6 +13,7 @@ use crate::components::{ Controller, Position, AttackInbox, + AttackMessage, Fighter, Health, ControlCooldown, @@ -63,9 +64,7 @@ impl <'a> System<'a> for Fight { _ => {} } if let Some(ent) = target { - let mut attack = fighter.attack.clone(); - attack.attacker = Some(entity); - AttackInbox::add_message(&mut attacked, ent, attack); + AttackInbox::add_message(&mut attacked, ent, AttackMessage{typ: fighter.attack.clone(), attacker: Some(entity)}); cooldowns.insert(entity, ControlCooldown{amount: fighter.cooldown}).unwrap(); if let Some(autofighter) = autofighters.get_mut(entity){ autofighter.target = Some(ent); |
