move out switching station run function
This commit is contained in:
parent
6710c2875b
commit
8c0481ed5e
|
@ -7,11 +7,10 @@ dofile(path.."/LV/init.lua")
|
|||
dofile(path.."/MV/init.lua")
|
||||
dofile(path.."/HV/init.lua")
|
||||
|
||||
|
||||
|
||||
dofile(path.."/switching_station.lua")
|
||||
dofile(path.."/switching_station_globalstep.lua")
|
||||
|
||||
dofile(path.."/power_monitor.lua")
|
||||
dofile(path.."/supply_converter.lua")
|
||||
|
||||
dofile(path.."/other/init.lua")
|
||||
|
||||
|
|
|
@ -258,12 +258,7 @@ local function run_nodes(list, run_stage)
|
|||
end
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:switching_station"},
|
||||
label = "Switching Station", -- allows the mtt profiler to profile this abm individually
|
||||
interval = 1.1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
technic.switching_station_run = function(pos)
|
||||
if not technic.powerctrl_state then return end
|
||||
|
||||
local t0 = minetest.get_us_time()
|
||||
|
@ -490,8 +485,7 @@ minetest.register_abm({
|
|||
end
|
||||
|
||||
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- Timeout ABM
|
||||
-- Timeout for a node in case it was disconnected from the network
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:switching_station"},
|
||||
label = "Switching Station",
|
||||
interval = 1.1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
technic.switching_station_run(pos)
|
||||
end
|
||||
})
|
Loading…
Reference in New Issue