mirror of
https://github.com/minetest-mods/technic.git
synced 2024-12-22 05:42:33 +01:00
use the timers, that are allready running instead of allocating a new one every tick
This commit is contained in:
parent
f250e1632f
commit
3252da05d1
@ -319,7 +319,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", {
|
|||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
-- Connected back?
|
-- Connected back?
|
||||||
if meta:get_int("HV_EU_timeout") > 0 then return end
|
if meta:get_int("HV_EU_timeout") > 0 then return false end
|
||||||
|
|
||||||
local burn_time = meta:get_int("burn_time") or 0
|
local burn_time = meta:get_int("burn_time") or 0
|
||||||
|
|
||||||
@ -329,12 +329,11 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", {
|
|||||||
technic.swap_node(pos, "technic:hv_nuclear_reactor_core")
|
technic.swap_node(pos, "technic:hv_nuclear_reactor_core")
|
||||||
meta:set_int("structure_accumulated_badness", 0)
|
meta:set_int("structure_accumulated_badness", 0)
|
||||||
siren_clear(pos, meta)
|
siren_clear(pos, meta)
|
||||||
return
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
meta:set_int("burn_time", burn_time + 1)
|
meta:set_int("burn_time", burn_time + 1)
|
||||||
local timer = minetest.get_node_timer(pos)
|
return true
|
||||||
timer:start(1)
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ function technic.register_generator(data)
|
|||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
-- Connected back?
|
-- Connected back?
|
||||||
if meta:get_int(tier.."_EU_timeout") > 0 then return end
|
if meta:get_int(tier.."_EU_timeout") > 0 then return false end
|
||||||
|
|
||||||
local burn_time = meta:get_int("burn_time") or 0
|
local burn_time = meta:get_int("burn_time") or 0
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ function technic.register_generator(data)
|
|||||||
meta:set_int(tier.."_EU_supply", 0)
|
meta:set_int(tier.."_EU_supply", 0)
|
||||||
meta:set_int("burn_time", 0)
|
meta:set_int("burn_time", 0)
|
||||||
technic.swap_node(pos, "technic:"..ltier.."_generator")
|
technic.swap_node(pos, "technic:"..ltier.."_generator")
|
||||||
return
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local burn_totaltime = meta:get_int("burn_totaltime") or 0
|
local burn_totaltime = meta:get_int("burn_totaltime") or 0
|
||||||
@ -158,8 +158,7 @@ function technic.register_generator(data)
|
|||||||
"image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:"..
|
"image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:"..
|
||||||
(percent)..":default_furnace_fire_fg.png]"..
|
(percent)..":default_furnace_fire_fg.png]"..
|
||||||
"list[current_player;main;0, 5;8, 4;]")
|
"list[current_player;main;0, 5;8, 4;]")
|
||||||
local timer = minetest.get_node_timer(pos)
|
return true
|
||||||
timer:start(1)
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user