From 9ee0ef5a8d60fae8efbd7732f9212d0b3d8570f6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 30 Apr 2020 20:57:38 +0200 Subject: [PATCH] Explosions: Replace some API calls --- mods/CORE/mcl_explosions/init.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index 1c016c0801..02a7d7ae16 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -29,15 +29,13 @@ local node_blastres = {} local node_on_blast = {} local node_walkable = {} -local AIR_CID = minetest.get_content_id('air') - -- The step length for the rays (Minecraft uses 0.3) local STEP_LENGTH = 0.3 -- How many rays to compute entity exposure to explosion local N_EXPOSURE_RAYS = 16 -minetest.after(0, function() +minetest.register_on_mods_loaded(function()) -- Store blast resistance values by content ids to improve performance. for name, def in pairs(minetest.registered_nodes) do node_blastres[minetest.get_content_id(name)] = def._mcl_blast_resistance or 0 @@ -245,7 +243,7 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) break end - if cid ~= AIR_CID then + if cid ~= minetest.CONTENT_AIR then destroy[hash] = idx end end @@ -368,7 +366,7 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) end end if remove then - data[idx] = AIR_CID + data[idx] = minetest.CONTENT_AIR end end