From 4e8698b7de57fb65fcb6c221fd519d97c9c6de9b Mon Sep 17 00:00:00 2001 From: isaacdd Date: Tue, 1 Jun 2021 16:29:39 +0200 Subject: [PATCH] Update raymath.h --- src/raymath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raymath.h b/src/raymath.h index 9d840443d..7d1e36266 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -326,7 +326,7 @@ RMDEF Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance) float dy = target.y - v.y; float value = (dx*dx) + (dy*dy); - if ((value == 0) || ((maxDistance >= 0) && (value <= maxDistance*maxDistance))) result = target; + if ((value == 0) || ((maxDistance >= 0) && (value <= maxDistance * maxDistance))) return target; float dist = sqrtf(value);