Currently the explosives just offload the work to the TNT mod of MTG or MCL. I guess using tnt.boom is technically abuse because it expects a node. I could place a tnt block first or rewrite the entire explosion logic. The problem is that in MTG tnt is a node rather than an entity. Makes it complicated. I'll think about it. Grenades don't even have an owner right now.
Could any explosive check if a node is protected or air before running tnt.boom on it? Its still annoying though because it destroys indestrucible blocks
"because it destroys indestrucible blocks" That's still an issue. Possibly even more than before. At that point I may as well write custom explosion logic. Some other time maybe.
I wont be able to test for a few hours, but I looked at the tnt.boom function.
def.explode_center = true might fix the issue, since it just deletes the node when set to false(not intuitive at all)
function tnt.boom(pos, def)
def = def or {}
def.radius = def.radius or 1
def.damage_radius = def.damage_radius or def.radius * 2
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
if not def.explode_center and def.ignore_protection ~= true then
minetest.set_node(pos, {name = "tnt:boom"})
end
local sound = def.sound or "tnt_explode"
minetest.sound_play(sound, {pos = pos, gain = 2.5,
max_hear_distance = math.min(def.radius * 20, 128)}, true)
local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection,
def.ignore_on_blast, owner, def.explode_center)
-- append entity drops
local damage_radius = (radius / math.max(1, def.radius)) * def.damage_radius
entity_physics(pos, damage_radius, drops)
if not def.disable_drops then
eject_drops(drops, pos, radius)
end
add_effects(pos, radius, drops)
minetest.log("action", "A TNT explosion occurred at " .. minetest.pos_to_string(pos) ..
" with radius " .. radius)
end
what the title says
Currently the explosives just offload the work to the TNT mod of MTG or MCL. I guess using tnt.boom is technically abuse because it expects a node. I could place a tnt block first or rewrite the entire explosion logic. The problem is that in MTG tnt is a node rather than an entity. Makes it complicated. I'll think about it. Grenades don't even have an owner right now.
Could any explosive check if a node is protected or air before running tnt.boom on it? Its still annoying though because it destroys indestrucible blocks
Can you test 1.5?
"because it destroys indestrucible blocks" That's still an issue. Possibly even more than before. At that point I may as well write custom explosion logic. Some other time maybe.
I wont be able to test for a few hours, but I looked at the tnt.boom function. def.explode_center = true might fix the issue, since it just deletes the node when set to false(not intuitive at all)
Looks like it did work, no more prot bypassing. Thanks!