Prevent a random crash when particle texture is not valid
This commit is contained in:
parent
0f92ac9425
commit
a541304155
1 changed files with 3 additions and 0 deletions
|
@ -20,6 +20,9 @@ local timer = 0
|
||||||
local shots = {}
|
local shots = {}
|
||||||
|
|
||||||
local function spawn_particles(p, v, d, texture)
|
local function spawn_particles(p, v, d, texture)
|
||||||
|
if texture.type ~= "string" then
|
||||||
|
texture = SHOOTER_EXPLOSION_TEXTURE
|
||||||
|
end
|
||||||
local pos = vector.add(p, vector.multiply(v, {x=d, y=d, z=d}))
|
local pos = vector.add(p, vector.multiply(v, {x=d, y=d, z=d}))
|
||||||
pos.y = pos.y + 0.75
|
pos.y = pos.y + 0.75
|
||||||
local spread = {x=0.1, y=0.1, z=0.1}
|
local spread = {x=0.1, y=0.1, z=0.1}
|
||||||
|
|
Loading…
Reference in a new issue