diff options
Diffstat (limited to 'server/protocol')
-rw-r--r-- | server/protocol/src/movement.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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<IVec2>, 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.; |