diff --git a/src/m_fixed.c b/src/m_fixed.c index 3724144f76700f8d7085feaff5b2b44e1e2d086f..65235cbcc89efea22c00742414050f41f9ed16c9 100644 --- a/src/m_fixed.c +++ b/src/m_fixed.c @@ -223,9 +223,7 @@ fixed_t FV2_Distance(const vector2_t *p1, const vector2_t *p2) fixed_t FV2_Magnitude(const vector2_t *a_normal) { - fixed_t xs = FixedMul(a_normal->x, a_normal->x); - fixed_t ys = FixedMul(a_normal->y, a_normal->y); - return FixedSqrt(xs + ys); + return FixedHypot(a_normal->x, a_normal->y); // Much less prone to overflowing } // Also returns the magnitude