1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-26 07:03:22 +00:00

Use tonumber instead of checking type

This commit is contained in:
SquidDev 2017-05-03 18:21:14 +01:00
parent 7e5970673f
commit 67eecd4b1c

View File

@ -76,9 +76,9 @@ local vmetatable = {
function new( x, y, z )
local v = {
x = type(x) == "number" and x or 0,
y = type(y) == "number" and y or 0,
z = type(z) == "number" and z or 0
x = tonumber(x) or 0,
y = tonumber(y) or 0,
z = tonumber(z) or 0
}
setmetatable( v, vmetatable )
return v