From 494dbfedb3d79907208176edbf152ff618192d15 Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 18 Jun 2023 16:14:30 +0200 Subject: [PATCH] clamp_magnitude no longer outputs input x,y regardless of checks --- src/corelib/math/vec.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/math/vec.h b/src/corelib/math/vec.h index a98452f..601e6c4 100644 --- a/src/corelib/math/vec.h +++ b/src/corelib/math/vec.h @@ -10,8 +10,9 @@ void clamp_magnitude(float* xx, float* yy, float max_magnitude) { if(m > max_magnitude) { x /= m; y /= m; x *= max_magnitude; y *= max_magnitude; + } else { + *xx = x; *yy = y; } - *xx = x; *yy = y; } static inline