forked from VoxeLibre/VoxeLibre
Add saftey measures in case the variables are nil and can't perform arithmetic functions
This commit is contained in:
parent
2d2b64006b
commit
242209e5f0
|
@ -259,12 +259,12 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc
|
|||
|
||||
if collisionbox then
|
||||
-- Create rays from random points in the collision box
|
||||
local x1 = collisionbox[1]
|
||||
local y1 = collisionbox[2]
|
||||
local z1 = collisionbox[3]
|
||||
local x2 = collisionbox[4]
|
||||
local y2 = collisionbox[5]
|
||||
local z2 = collisionbox[6]
|
||||
local x1 = collisionbox[1] or 0.0
|
||||
local y1 = collisionbox[2] or 0.0
|
||||
local z1 = collisionbox[3] or 0.0
|
||||
local x2 = collisionbox[4] or 0.0
|
||||
local y2 = collisionbox[5] or 0.0
|
||||
local z2 = collisionbox[6] or 0.0
|
||||
local x_len = math.abs(x2 - x1)
|
||||
local y_len = math.abs(y2 - y1)
|
||||
local z_len = math.abs(z2 - z1)
|
||||
|
|
Loading…
Reference in New Issue