I agree about that. I will remove my calculation.
my problem is that it will not actually run the on_blast function. I am working on entity-based tnt that will explode and "light" certain nodes, and turn them into entity, which explode, and light other nodes, etc.
repaired code:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local function destroy(drops, pos, cid, center, radius)
if minetest.is_protected(pos, "") then
return
end
local def = cid_data[cid]
if def and def.flammable then
minetest.set_node(pos, fire_node)
else
local blast = def.on_blast
if blast ~= nil then
blast(pos, 1)
else
minetest.remove_node(pos)
if def then
local node_drops = minetest.get_node_drops(def.name, "")
for _, item in ipairs(node_drops) do
add_drop(drops, item)
end
end
end
end
end
the tnt node (that should be lit) is being dropped, and its on_blast function is ignored.