diff options
| author | troido <troido@protonmail.com> | 2020-02-23 22:12:21 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-02-23 22:12:21 +0100 |
| commit | f422238d7aaae0ff1b2d560a71a99b0a881ad338 (patch) | |
| tree | c335cb8eee47d34953f7d4cd96c195958d223202 /src/systems/attacking.rs | |
| parent | 613952f918b8d72a3e397dc46be309b2320c6ad0 (diff) | |
players can get damage from traps
Diffstat (limited to 'src/systems/attacking.rs')
| -rw-r--r-- | src/systems/attacking.rs | 2 |
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(); } } |
