Skip to content

Commit

Permalink
Don't assert scalars must be vectors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cy authored and kwolekr committed Nov 7, 2013
1 parent 8ad0528 commit 3d63492
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions builtin/vector.lua
Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand Down

0 comments on commit 3d63492

Please sign in to comment.