Fix crash when blowing up an unknown node

Unknown nodes get a blast resistance of zero.
This commit is contained in:
Elias Åström 2021-04-22 12:38:55 +02:00
parent fda2d41b4e
commit 31341ca57b

View file

@ -202,7 +202,10 @@ local function trace_explode(pos, strength, raydirs, radius, info, puncher)
npos_x - emin_x + 1 npos_x - emin_x + 1
local cid = data[idx] local cid = data[idx]
local br = node_blastres[cid]
-- Set blast resistance to 0 for unknown nodes
local br = node_blastres[cid] or 0
if br < INDESTRUCT_BLASTRES and br > max_blast_resistance then if br < INDESTRUCT_BLASTRES and br > max_blast_resistance then
br = max_blast_resistance br = max_blast_resistance
end end