@@ -67,45 +67,48 @@ ::collcheck:: do -- if no collision then return end local nname = minetest.get_node(pos).name - if nname == 'air' then return + if nname == 'air' or minetest.registered_nodes[nname].walkable ~= true then return elseif nname == 'ignore' then goto destroy end -- else fall through to explode end ::explode:: do - minetest.add_particle({ - pos = pos, - velocity = { x = 0, y = 0, z = 0 }; - acceleration = { x = 0, y = 0, z = 0 }; - expirationtime = 0.4, - size = 50, - collisiondetection = false, - vertical = false, - texture = "tnt_boom.png", - glow = 14, - }) + -- minetest.add_particle({ + -- pos = pos, + -- velocity = { x = 0, y = 0, z = 0 }; + -- acceleration = { x = 0, y = 0, z = 0 }; + -- expirationtime = 0.4, + -- size = 50, + -- collisiondetection = false, + -- vertical = false, + -- texture = "tnt_boom.png", + -- glow = 14, + -- }) local boom = function(len,num,speed) - minetest.add_particlespawner { - amount = num; - time = len; - minpos = vector.subtract(pos, 1.2); - maxpos = vector.add(pos, 1,2); - minvel = vector.multiply({ x = -10; y = -10; z = -10; }, speed); - maxvel = vector.multiply({ x = 10; y = 10; z = 10; }, speed); - minacc = vector.multiply({ x = -1; y = -1; z = -1; }, speed); - maxacc = vector.multiply({ x = 1; y = 1; z = 1; }, speed); - minexptime = 0.1; - maxexptime = 0.3; - minsize = 6; - maxsize = 25; - texture = 'tnt_smoke.png'; - } + -- minetest.add_particlespawner { + -- amount = num; + -- time = len; + -- minpos = vector.subtract(pos, 1.2); + -- maxpos = vector.add(pos, 1,2); + -- minvel = vector.multiply({ x = -10; y = -10; z = -10; }, speed); + -- maxvel = vector.multiply({ x = 10; y = 10; z = 10; }, speed); + -- minacc = vector.multiply({ x = -1; y = -1; z = -1; }, speed); + -- maxacc = vector.multiply({ x = 1; y = 1; z = 1; }, speed); + -- minexptime = 0.1; + -- maxexptime = 0.3; + -- minsize = 6; + -- maxsize = 25; + -- texture = 'tnt_smoke.png'; + -- } end boom(0.7, 140, 0.8) - minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 40}, true) + -- minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 40}, true) + tnt.boom(pos, { + radius = self._blastradius; + }) end ::destroy:: do if self._meta then for _,v in pairs(self._meta.emitters) do