summaryrefslogtreecommitdiff
path: root/src/systems/attacking.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-23 22:12:21 +0100
committertroido <troido@protonmail.com>2020-02-23 22:12:21 +0100
commitf422238d7aaae0ff1b2d560a71a99b0a881ad338 (patch)
treec335cb8eee47d34953f7d4cd96c195958d223202 /src/systems/attacking.rs
parent613952f918b8d72a3e397dc46be309b2320c6ad0 (diff)
players can get damage from traps
Diffstat (limited to 'src/systems/attacking.rs')
-rw-r--r--src/systems/attacking.rs2
1 files changed, 1 insertions, 1 deletions
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();
}
}