mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Reset controller after each tick
This commit is contained in:
parent
4d6a32e00f
commit
808467c616
15
common/src/sys/cleanup.rs
Normal file
15
common/src/sys/cleanup.rs
Normal file
@ -0,0 +1,15 @@
|
||||
use crate::comp::Controller;
|
||||
use specs::{Entities, Join, System, WriteStorage};
|
||||
use vek::*;
|
||||
|
||||
/// This system will allow NPCs to modify their controller
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
type SystemData = (Entities<'a>, WriteStorage<'a, Controller>);
|
||||
|
||||
fn run(&mut self, (entities, mut controllers): Self::SystemData) {
|
||||
for controller in (&mut controllers).join() {
|
||||
*controller = Controller::default();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user