aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/AISystem.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-07 15:55:09 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-07 15:55:09 +0100
commitd836022aeb120b483c8ddf54cabe0f4325e68803 (patch)
treec09952570ac3732dfd821ae00fe379330e513e7c /src/crepe/system/AISystem.cpp
parenta61149733e8661c97f15fc99e5b28489c29a2b22 (diff)
parent3f4be8dd73792b8937cdba4934b8938be163ac7a (diff)
merge ai
Diffstat (limited to 'src/crepe/system/AISystem.cpp')
-rw-r--r--src/crepe/system/AISystem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crepe/system/AISystem.cpp b/src/crepe/system/AISystem.cpp
index 55dc14c..324ee5f 100644
--- a/src/crepe/system/AISystem.cpp
+++ b/src/crepe/system/AISystem.cpp
@@ -130,7 +130,7 @@ vec2 AISystem::arrive(const AI & ai) {
float distance = to_target.length();
if (distance > 0.0f) {
float speed = distance / ai.arrive_deceleration;
- speed = std::min(speed, rigidbody.data.max_linear_velocity.length());
+ speed = std::min(speed, rigidbody.data.max_linear_velocity);
vec2 desired_velocity = to_target * (speed / distance);
return desired_velocity - rigidbody.data.linear_velocity;