From 28a906863db6e3171901fe2f8cf43c09de9138d6 Mon Sep 17 00:00:00 2001 From: DustyDave961 <144002335+DustyDave961@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:08:00 -0600 Subject: [PATCH] Update radiation.lua Shouldn't the resistance cache be initialized before the node_radiation_resistance function? --- technic/radiation.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/technic/radiation.lua b/technic/radiation.lua index 9d0cede0..47f9eb6c 100644 --- a/technic/radiation.lua +++ b/technic/radiation.lua @@ -185,6 +185,7 @@ technic.register_group_resistance("tree", 3.4) technic.register_group_resistance("uranium_block", 500) technic.register_group_resistance("wood", 1.7) +--Radiation resistances cache technic.resistance_cache = {} function technic.cache_resistances() @@ -197,6 +198,8 @@ function technic.cache_resistances() end end +technic.cache_resistances() + local function node_radiation_resistance(node_name) local cached_resistance = technic.resistance_cache[node_name] if cached_resistance then @@ -206,9 +209,6 @@ local function node_radiation_resistance(node_name) end end --- Initialize cache -technic.cache_resistances() - --[[ Radioactive nodes cause damage to nearby players. The damage effect depends on the intrinsic strength of the radiation source,