diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-21 12:49:39 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:26:47 +0200 |
commit | 1c9ddc8b8753696062bc999a5e5cf8620e518b11 (patch) | |
tree | 41ae89eb296f37eacba0a296bfc7b23f019f04a0 /server/src/customer/pathfinding.rs | |
parent | 1ab1fd8cc03678ac180673884eff098821bcecd2 (diff) | |
download | hurrycurry-1c9ddc8b8753696062bc999a5e5cf8620e518b11.tar hurrycurry-1c9ddc8b8753696062bc999a5e5cf8620e518b11.tar.bz2 hurrycurry-1c9ddc8b8753696062bc999a5e5cf8620e518b11.tar.zst |
move collision force and customer speed adjusted
Diffstat (limited to 'server/src/customer/pathfinding.rs')
-rw-r--r-- | server/src/customer/pathfinding.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/src/customer/pathfinding.rs b/server/src/customer/pathfinding.rs index d25c6913..26de9c51 100644 --- a/server/src/customer/pathfinding.rs +++ b/server/src/customer/pathfinding.rs @@ -21,7 +21,11 @@ impl Path { if next.distance(customer.position) < if self.0.len() == 1 { 0.1 } else { 0.6 } { self.0.pop(); } - customer.update(&walkable, next - customer.position, dt) + customer.update( + &walkable, + (next - customer.position).normalize_or_zero() * 0.5, + dt, + ) } else { customer.update(&walkable, Vec2::ZERO, dt) } |