fixed min and max

This commit is contained in:
VorTechnix 2021-06-26 21:39:16 -07:00 committed by GitHub
parent f32d8588e0
commit 3467f9c5b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,7 +110,7 @@ end
-- @param pos2 Vector pos2 of the defined region. -- @param pos2 Vector pos2 of the defined region.
-- @return Vector Min values from input vectors. -- @return Vector Min values from input vectors.
function worldeditadditions.vector.min(pos1, pos2) function worldeditadditions.vector.min(pos1, pos2)
return vector.new(math.min(pos1.x + pos2.x), math.min(pos1.y + pos2.y), math.min(pos1.z + pos2.z)) return vector.new(math.min(pos1.x, pos2.x), math.min(pos1.y, pos2.y), math.min(pos1.z, pos2.z))
end end
--- Returns a vector of the max values of 2 positions. --- Returns a vector of the max values of 2 positions.
@ -118,5 +118,5 @@ end
-- @param pos2 Vector pos2 of the defined region. -- @param pos2 Vector pos2 of the defined region.
-- @return Vector Max values from input vectors. -- @return Vector Max values from input vectors.
function worldeditadditions.vector.max(pos1, pos2) function worldeditadditions.vector.max(pos1, pos2)
return vector.new(math.max(pos1.x + pos2.x), math.max(pos1.y + pos2.y), math.max(pos1.z + pos2.z)) return vector.new(math.max(pos1.x, pos2.x), math.max(pos1.y, pos2.y), math.max(pos1.z, pos2.z))
end end