diff options
| author | troido <troido@protonmail.com> | 2020-03-02 22:28:03 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-03-02 22:28:03 +0100 |
| commit | 22168c8eedac95fdfde9a536a1d1f6ddf622cfa1 (patch) | |
| tree | 6870bff418367fc635d64b58b3921d85ee0dbbb0 /src/systems/attacking.rs | |
| parent | 27c0795fb70739ce5609a0f424d80491d4a8c5a1 (diff) | |
added purgatory
Diffstat (limited to 'src/systems/attacking.rs')
| -rw-r--r-- | src/systems/attacking.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/systems/attacking.rs b/src/systems/attacking.rs index d28e301..6075bd5 100644 --- a/src/systems/attacking.rs +++ b/src/systems/attacking.rs @@ -9,7 +9,7 @@ use specs::{ }; use crate::{ - components::{Health, AttackInbox, Dying, Removed, Position}, + components::{Health, AttackInbox, Dead, Position}, resources::NewEntities, Template, util @@ -22,12 +22,11 @@ impl <'a> System<'a> for Attacking { Entities<'a>, WriteStorage<'a, AttackInbox>, WriteStorage<'a, Health>, - WriteStorage<'a, Dying>, - WriteStorage<'a, Removed>, + WriteStorage<'a, Dead>, ReadStorage<'a, Position>, Write<'a, NewEntities> ); - fn run(&mut self, (entities, mut attackeds, mut healths, mut deads, mut removals, positions, mut new): Self::SystemData) { + fn run(&mut self, (entities, mut attackeds, mut healths, mut deads, positions, mut new): Self::SystemData) { for (ent, health, attacked) in (&entities, &mut healths, &mut attackeds).join() { let mut wounded = false; for attack in attacked.messages.drain(..) { @@ -38,8 +37,7 @@ impl <'a> System<'a> for Attacking { } health.health = util::clamp(health.health, 0, health.maxhealth); if health.health == 0 { - deads.insert(ent, Dying).unwrap(); - removals.insert(ent, Removed).unwrap(); + deads.insert(ent, Dead).unwrap(); } if let Some(position) = positions.get(ent){ if wounded { |
