Fix nil item exception and node particle texture

This commit is contained in:
stujones11 2013-12-24 21:44:51 +00:00
parent a541304155
commit 4d0fd5b93c

View file

@ -20,7 +20,7 @@ local timer = 0
local shots = {}
local function spawn_particles(p, v, d, texture)
if texture.type ~= "string" then
if type(texture) ~= "string" then
texture = SHOOTER_EXPLOSION_TEXTURE
end
local pos = vector.add(p, vector.multiply(v, {x=d, y=d, z=d}))
@ -55,9 +55,7 @@ local function punch_node(pos, def)
return
end
local item = minetest.registered_items[node.name]
if not item.groups then
return
end
if item and item.groups then
for k, v in pairs(def.groups) do
local level = item.groups[k] or 0
if level >= v then
@ -78,6 +76,7 @@ local function punch_node(pos, def)
end
end
end
end
function shooter:fire_weapon(user, pointed_thing, def)
local name = user:get_player_name()