aboutsummaryrefslogtreecommitdiff
path: root/server/src/customer/movement.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-21 12:49:39 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-23 19:26:47 +0200
commit1c9ddc8b8753696062bc999a5e5cf8620e518b11 (patch)
tree41ae89eb296f37eacba0a296bfc7b23f019f04a0 /server/src/customer/movement.rs
parent1ab1fd8cc03678ac180673884eff098821bcecd2 (diff)
downloadhurrycurry-1c9ddc8b8753696062bc999a5e5cf8620e518b11.tar
hurrycurry-1c9ddc8b8753696062bc999a5e5cf8620e518b11.tar.bz2
hurrycurry-1c9ddc8b8753696062bc999a5e5cf8620e518b11.tar.zst
move collision force and customer speed adjusted
Diffstat (limited to 'server/src/customer/movement.rs')
-rw-r--r--server/src/customer/movement.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/src/customer/movement.rs b/server/src/customer/movement.rs
index b45c7931..6a70a44f 100644
--- a/server/src/customer/movement.rs
+++ b/server/src/customer/movement.rs
@@ -13,7 +13,7 @@ pub struct MovementBase {
impl MovementBase {
pub fn update(&mut self, map: &HashSet<IVec2>, direction: Vec2, dt: f32) -> PacketS {
- let direction = direction.normalize_or_zero();
+ let direction = direction.clamp_length_max(1.);
if direction.length() > 0.1 {
self.facing = direction + (self.facing - direction) * (-dt * 10.).exp();
}