diff options
Diffstat (limited to 'src/systems/heal.rs')
| -rw-r--r-- | src/systems/heal.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/systems/heal.rs b/src/systems/heal.rs index 458bc17..34e67f4 100644 --- a/src/systems/heal.rs +++ b/src/systems/heal.rs @@ -8,7 +8,7 @@ use specs::{ use crate::{ components::{Health, Healing}, - resources::TimeStamp + resources::Time }; @@ -17,19 +17,19 @@ impl <'a> System<'a> for Heal { type SystemData = ( WriteStorage<'a, Health>, WriteStorage<'a, Healing>, - Read<'a, TimeStamp> + Read<'a, Time> ); - fn run(&mut self, (mut healths, mut healing, timestamp): Self::SystemData) { + fn run(&mut self, (mut healths, mut healing, time): Self::SystemData) { for (health, mut heal) in (&mut healths, &mut healing).join() { if let Some(next_heal) = heal.next_heal { - if next_heal <= timestamp.time { + if next_heal <= time.time { health.heal(heal.health); heal.next_heal = None } } if health.health < health.maxhealth && heal.next_heal == None { - heal.next_heal = Some(timestamp.time + heal.delay) + heal.next_heal = Some(time.time + heal.delay) } } } |
