1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Add math.round and fix vector.round (#10803)

This commit is contained in:
Vincent Robinson 2021-04-01 15:18:58 -07:00 committed by GitHub
parent 1e4913cd76
commit 3560691c0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 4 deletions

View file

@ -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