1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-13 11:40:29 +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 ) function new( x, y, z )
local v = { local v = {
x = type(x) == "number" and x or 0, x = tonumber(x) or 0,
y = type(y) == "number" and y or 0, y = tonumber(y) or 0,
z = type(z) == "number" and z or 0 z = tonumber(z) or 0
} }
setmetatable( v, vmetatable ) setmetatable( v, vmetatable )
return v return v