mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 09:31:07 +01:00
Don't crash if TNT wants to blow up unknown node
This commit is contained in:
parent
4550760756
commit
6fb818d7bf
1 changed files with 1 additions and 1 deletions
|
@ -178,7 +178,7 @@ function TNT:on_step(dtime)
|
||||||
local def = minetest.registered_nodes[n.name]
|
local def = minetest.registered_nodes[n.name]
|
||||||
-- Simple blast resistance check (for now). This keeps the important blocks like bedrock, command block, etc. intact.
|
-- Simple blast resistance check (for now). This keeps the important blocks like bedrock, command block, etc. intact.
|
||||||
-- TODO: Implement the real blast resistance algorithm
|
-- TODO: Implement the real blast resistance algorithm
|
||||||
if n.name ~= "air" and n.name ~= "ignore" and (def._mcl_blast_resistance == nil or def._mcl_blast_resistance < 1000) then
|
if def and n.name ~= "air" and n.name ~= "ignore" and (def._mcl_blast_resistance == nil or def._mcl_blast_resistance < 1000) then
|
||||||
activate_if_tnt(n.name, np, pos, 3)
|
activate_if_tnt(n.name, np, pos, 3)
|
||||||
minetest.remove_node(np)
|
minetest.remove_node(np)
|
||||||
core.check_for_falling(np)
|
core.check_for_falling(np)
|
||||||
|
|
Loading…
Reference in a new issue