From 13511e28cd3cc00666252ee4a8ae487807202215 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Sun, 10 Nov 2024 08:06:13 -0800 Subject: [PATCH] Fix runtime error when computing the dot product via `utilities.lua` (#6527) --- changelog/snippets/other.6438.md | 2 +- lua/utilities.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog/snippets/other.6438.md b/changelog/snippets/other.6438.md index 711be31cd4..983cdb4dc4 100644 --- a/changelog/snippets/other.6438.md +++ b/changelog/snippets/other.6438.md @@ -1,4 +1,4 @@ -- (#5061, #6438) Add metamethods and utility functions for Vectors and Quaternions to simplify and clean up the code involving operations with them. +- (#5061, #6438, #6527) Add metamethods and utility functions for Vectors and Quaternions to simplify and clean up the code involving operations with them. - This **removes** the file `/lua/shared/quaternions.lua`, which was added in #4768 (Mar 4, 2023), so mods that use that file will have to be updated. - The metamethods (defined globally in `/lua/system/utils.lua`) include: - Vector/Vector2 addition/subtraction/negation diff --git a/lua/utilities.lua b/lua/utilities.lua index 43f5eecd53..4423c723ed 100644 --- a/lua/utilities.lua +++ b/lua/utilities.lua @@ -391,7 +391,7 @@ end ---@param v2 Vector ---@return number function DotP(v1, v2) - return v1[1] * v2[1] + v1[2] * v[2] + v[3] * v[3] + return v1[1] * v2[1] + v1[2] * v2[2] + v1[3] * v2[3] end --- Returns the conjugate of a quaternion