From: Cy Date: Thu, 7 Nov 2013 03:08:18 +0000 (-0800) Subject: Don't assert scalars must be vectors. X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=3d63492f50ecc547197df1818417d339906091f6;p=zefram%2Fminetest%2Fminetest_engine.git Don't assert scalars must be vectors. --- diff --git a/builtin/vector.lua b/builtin/vector.lua index 6b787366..77944b61 100644 --- a/builtin/vector.lua +++ b/builtin/vector.lua @@ -90,8 +90,8 @@ end function vector.add(a, b) assert_vector(a) - assert_vector(b) if type(b) == "table" then + assert_vector(b) return {x = a.x + b.x, y = a.y + b.y, z = a.z + b.z} @@ -104,8 +104,8 @@ end function vector.subtract(a, b) assert_vector(a) - assert_vector(b) if type(b) == "table" then + assert_vector(b) return {x = a.x - b.x, y = a.y - b.y, z = a.z - b.z} @@ -118,8 +118,8 @@ end function vector.multiply(a, b) assert_vector(a) - assert_vector(b) if type(b) == "table" then + assert_vector(b) return {x = a.x * b.x, y = a.y * b.y, z = a.z * b.z} @@ -132,8 +132,8 @@ end function vector.divide(a, b) assert_vector(a) - assert_vector(b) if type(b) == "table" then + assert_vector(b) return {x = a.x / b.x, y = a.y / b.y, z = a.z / b.z}