From f422238d7aaae0ff1b2d560a71a99b0a881ad338 Mon Sep 17 00:00:00 2001 From: troido Date: Sun, 23 Feb 2020 22:12:21 +0100 Subject: players can get damage from traps --- src/systems/attacking.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/systems/attacking.rs') diff --git a/src/systems/attacking.rs b/src/systems/attacking.rs index 0fb5cf7..6535a75 100644 --- a/src/systems/attacking.rs +++ b/src/systems/attacking.rs @@ -18,13 +18,13 @@ impl <'a> System<'a> for Attacking { WriteStorage<'a, Health> ); fn run(&mut self, (mut victims, mut healths): Self::SystemData) { - for (health, attacked) in (&mut healths, &mut victims).join() { for attack in attacked.attacks.drain(..) { health.health -= attack.damage; } health.health = util::clamp(health.health, 0, health.maxhealth); } + victims.clear(); } } -- cgit