aboutsummaryrefslogtreecommitdiff
path: root/builtin/common/vector.lua
diff options
context:
space:
mode:
authorVincent Robinson <robinsonvincent89@gmail.com>2021-04-01 15:18:58 -0700
committerGitHub <noreply@github.com>2021-04-02 00:18:58 +0200
commit3560691c0aecd89dc7f7d91ed8c4f1eaa9715eaf (patch)
tree966ad8508d97379c612e4fa8ee9822aa481e5478 /builtin/common/vector.lua
parent1e4913cd76f5d31456d04a5ce23e66d5c60060de (diff)
downloadminetest-3560691c0aecd89dc7f7d91ed8c4f1eaa9715eaf.tar.xz
Add `math.round` and fix `vector.round` (#10803)
Diffstat (limited to 'builtin/common/vector.lua')
-rw-r--r--builtin/common/vector.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/common/vector.lua b/builtin/common/vector.lua
index d6437deda..b04c12610 100644
--- a/builtin/common/vector.lua
+++ b/builtin/common/vector.lua
@@ -41,9 +41,9 @@ end
function vector.round(v)
return {
- x = math.floor(v.x + 0.5),
- y = math.floor(v.y + 0.5),
- z = math.floor(v.z + 0.5)
+ x = math.round(v.x),
+ y = math.round(v.y),
+ z = math.round(v.z)
}
end