Make explosions respect SHOOTER_ALLOW_NODES setting

This commit is contained in:
stujones11 2014-07-27 17:31:32 +01:00
parent da6d0640e9
commit eba57b4152

View file

@ -343,7 +343,9 @@ function shooter:blast(pos, radius, fleshy, distance)
local p1 = vector.subtract(pos, radius) local p1 = vector.subtract(pos, radius)
local p2 = vector.add(pos, radius) local p2 = vector.add(pos, radius)
minetest.sound_play("tnt_explode", {pos=pos, gain=1}) minetest.sound_play("tnt_explode", {pos=pos, gain=1})
if SHOOTER_ALLOW_NODES == true then
minetest.set_node(pos, {name="tnt:boom"}) minetest.set_node(pos, {name="tnt:boom"})
end
if SHOOTER_ENABLE_PARTICLE_FX == true then if SHOOTER_ENABLE_PARTICLE_FX == true then
minetest.add_particlespawner(50, 0.1, minetest.add_particlespawner(50, 0.1,
p1, p2, {x=-0, y=-0, z=-0}, {x=0, y=0, z=0}, p1, p2, {x=-0, y=-0, z=-0}, {x=0, y=0, z=0},
@ -371,6 +373,9 @@ function shooter:blast(pos, radius, fleshy, distance)
end end
end end
end end
if SHOOTER_ALLOW_NODES == false then
return
end
local pr = PseudoRandom(os.time()) local pr = PseudoRandom(os.time())
local vm = VoxelManip() local vm = VoxelManip()
local min, max = vm:read_from_map(p1, p2) local min, max = vm:read_from_map(p1, p2)