diff options
| author | troido <troido@protonmail.com> | 2020-03-02 12:02:54 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-03-02 12:02:54 +0100 |
| commit | 27c0795fb70739ce5609a0f424d80491d4a8c5a1 (patch) | |
| tree | 1a6ab802edb717a42ca67a8d997cf960d7f4f5ed /src/systems/updatecooldowns.rs | |
| parent | d246537a28a7a71dfb2487d31d6fac3ccab5053d (diff) | |
added monster ai
Diffstat (limited to 'src/systems/updatecooldowns.rs')
| -rw-r--r-- | src/systems/updatecooldowns.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/systems/updatecooldowns.rs b/src/systems/updatecooldowns.rs index 73ca770..705561d 100644 --- a/src/systems/updatecooldowns.rs +++ b/src/systems/updatecooldowns.rs @@ -6,16 +6,18 @@ use specs::{ Join }; -use crate::components::ControlCooldown; +use crate::components::{Controller, ControlCooldown}; pub struct UpdateCooldowns; impl <'a> System<'a> for UpdateCooldowns { type SystemData = ( Entities<'a>, - WriteStorage<'a, ControlCooldown> + WriteStorage<'a, ControlCooldown>, + WriteStorage<'a, Controller> ); - fn run(&mut self, (entities, mut cooldowns): Self::SystemData) { + fn run(&mut self, (entities, mut cooldowns, mut controllers): Self::SystemData) { + controllers.clear(); let mut to_remove = Vec::new(); for (entity, cooldown) in (&entities, &mut cooldowns).join() { if cooldown.amount > 0 { |
