Skip to content

Commit

Permalink
Update radiation.lua
Browse files Browse the repository at this point in the history
Shouldn't the resistance cache be initialized before the node_radiation_resistance function?
  • Loading branch information
DustyDave961 authored Nov 20, 2024
1 parent feb853c commit 28a9068
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions technic/radiation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 28a9068

Please sign in to comment.