From a541304155a24e428e4feb0dea63e55729993e24 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Sat, 14 Dec 2013 20:26:34 +0000 Subject: [PATCH] Prevent a random crash when particle texture is not valid --- shooter.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shooter.lua b/shooter.lua index 5bea2ec..432dab0 100644 --- a/shooter.lua +++ b/shooter.lua @@ -20,6 +20,9 @@ local timer = 0 local shots = {} 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})) pos.y = pos.y + 0.75 local spread = {x=0.1, y=0.1, z=0.1}