mirror of
https://github.com/minetest-mods/technic.git
synced 2025-01-11 10:40:19 +01:00
Update radiation.lua
Shouldn't the resistance cache be initialized before the node_radiation_resistance function?
This commit is contained in:
parent
feb853c715
commit
28a906863d
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user