From 22168c8eedac95fdfde9a536a1d1f6ddf622cfa1 Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 2 Mar 2020 22:28:03 +0100 Subject: added purgatory --- src/systems/attacking.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/systems/attacking.rs') 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 { -- cgit