Fixes a bug where animals continually jumped after their target was any height above them, even once the target was no longer above them.

This commit is contained in:
Cody 2019-06-03 20:09:18 +00:00 committed by Joshua Barretto
parent 930bc91174
commit 692b216651
2 changed files with 2 additions and 7 deletions

View File

@ -310,12 +310,6 @@ impl Client {
// 7) Finish the tick, pass control back to the frontend.
// Cleanup
self.state
.ecs_mut()
.write_storage::<comp::Jumping>()
.remove(self.entity);
self.tick += 1;
Ok(frontend_events)
}

View File

@ -30,7 +30,7 @@ impl<'a> System<'a> for Sys {
WriteStorage<'a, AnimationInfo>,
WriteStorage<'a, Stats>,
ReadStorage<'a, Control>,
ReadStorage<'a, Jumping>,
WriteStorage<'a, Jumping>,
WriteStorage<'a, Respawning>,
WriteStorage<'a, Gliding>,
WriteStorage<'a, Attacking>,
@ -87,6 +87,7 @@ impl<'a> System<'a> for Sys {
if jumps.get(entity).is_some() {
vel.0.z += 16.0;
jumps.remove(entity);
}
(false, 0.15)