Prevent a random crash when particle texture is not valid

This commit is contained in:
stujones11 2013-12-14 20:26:34 +00:00
parent 0f92ac9425
commit a541304155

View file

@ -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}