forked from Mirrorlandia_minetest/tnt
Restructure code to only check def
once.
This commit is contained in:
parent
c9d4326a85
commit
802bc1edca
9
init.lua
9
init.lua
@ -88,13 +88,14 @@ local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue, ignore_p
|
||||
if not ignore_protection and minetest.is_protected(npos, "") then
|
||||
return cid
|
||||
end
|
||||
|
||||
local def = cid_data[cid]
|
||||
if not ignore_on_blast and def and def.on_blast then
|
||||
on_blast_queue[#on_blast_queue + 1] = {pos = vector.new(npos), on_blast = def.on_blast}
|
||||
return cid
|
||||
end
|
||||
|
||||
if not def then
|
||||
return c_air
|
||||
elseif not ignore_on_blast and def.on_blast then
|
||||
on_blast_queue[#on_blast_queue + 1] = {pos = vector.new(npos), on_blast = def.on_blast}
|
||||
return cid
|
||||
elseif def.flammable then
|
||||
return c_fire
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user