mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 23:22:24 +01:00
Don't assert scalars must be vectors.
This commit is contained in:
parent
8ad052881c
commit
3d63492f50
@ -90,8 +90,8 @@ end
|
|||||||
|
|
||||||
function vector.add(a, b)
|
function vector.add(a, b)
|
||||||
assert_vector(a)
|
assert_vector(a)
|
||||||
assert_vector(b)
|
|
||||||
if type(b) == "table" then
|
if type(b) == "table" then
|
||||||
|
assert_vector(b)
|
||||||
return {x = a.x + b.x,
|
return {x = a.x + b.x,
|
||||||
y = a.y + b.y,
|
y = a.y + b.y,
|
||||||
z = a.z + b.z}
|
z = a.z + b.z}
|
||||||
@ -104,8 +104,8 @@ end
|
|||||||
|
|
||||||
function vector.subtract(a, b)
|
function vector.subtract(a, b)
|
||||||
assert_vector(a)
|
assert_vector(a)
|
||||||
assert_vector(b)
|
|
||||||
if type(b) == "table" then
|
if type(b) == "table" then
|
||||||
|
assert_vector(b)
|
||||||
return {x = a.x - b.x,
|
return {x = a.x - b.x,
|
||||||
y = a.y - b.y,
|
y = a.y - b.y,
|
||||||
z = a.z - b.z}
|
z = a.z - b.z}
|
||||||
@ -118,8 +118,8 @@ end
|
|||||||
|
|
||||||
function vector.multiply(a, b)
|
function vector.multiply(a, b)
|
||||||
assert_vector(a)
|
assert_vector(a)
|
||||||
assert_vector(b)
|
|
||||||
if type(b) == "table" then
|
if type(b) == "table" then
|
||||||
|
assert_vector(b)
|
||||||
return {x = a.x * b.x,
|
return {x = a.x * b.x,
|
||||||
y = a.y * b.y,
|
y = a.y * b.y,
|
||||||
z = a.z * b.z}
|
z = a.z * b.z}
|
||||||
@ -132,8 +132,8 @@ end
|
|||||||
|
|
||||||
function vector.divide(a, b)
|
function vector.divide(a, b)
|
||||||
assert_vector(a)
|
assert_vector(a)
|
||||||
assert_vector(b)
|
|
||||||
if type(b) == "table" then
|
if type(b) == "table" then
|
||||||
|
assert_vector(b)
|
||||||
return {x = a.x / b.x,
|
return {x = a.x / b.x,
|
||||||
y = a.y / b.y,
|
y = a.y / b.y,
|
||||||
z = a.z / b.z}
|
z = a.z / b.z}
|
||||||
|
Loading…
Reference in New Issue
Block a user