From 0f1d37405a722c9c9d60cf5e9dac23bda93a7e8d Mon Sep 17 00:00:00 2001 From: Cody Date: Mon, 3 Jun 2019 20:09:18 +0000 Subject: [PATCH] Fixes a bug where animals continually jumped after their target was any height above them, even once the target was no longer above them. --- client/src/lib.rs | 6 ------ common/src/sys/inputs.rs | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index 2b03478ca2..61f16c482b 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -310,12 +310,6 @@ impl Client { // 7) Finish the tick, pass control back to the frontend. - // Cleanup - self.state - .ecs_mut() - .write_storage::() - .remove(self.entity); - self.tick += 1; Ok(frontend_events) } diff --git a/common/src/sys/inputs.rs b/common/src/sys/inputs.rs index 6ab540b84c..7e1f1216ee 100644 --- a/common/src/sys/inputs.rs +++ b/common/src/sys/inputs.rs @@ -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)