From 02af3843b695857e9832434336cf093968f00ff5 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 19 Sep 2024 20:41:33 +0200 Subject: update movement code everywhere --- server/protocol/src/movement.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'server/protocol/src') diff --git a/server/protocol/src/movement.rs b/server/protocol/src/movement.rs index ebcc627d..85accb31 100644 --- a/server/protocol/src/movement.rs +++ b/server/protocol/src/movement.rs @@ -58,10 +58,13 @@ impl MovementBase { } pub fn update(&mut self, map: &HashSet, dt: f32) { let mut boost = self.input_boost; - let direction = self.input_direction.clamp_length_max(1.); - if direction.length() > 0.1 { + let mut direction = self.input_direction.clamp_length_max(1.); + if direction.length() > 0.05 { self.facing = direction + (self.facing - direction) * (-dt * 10.).exp(); } + if direction.length() < 0.5 { + direction *= 0.; + } self.rotation = self.facing.x.atan2(self.facing.y); boost &= direction.length() > 0.1; self.boosting = boost && (self.boosting || self.stamina >= 1.) && self.stamina > 0.; -- cgit v1.2.3-70-g09d2