move out switching station run function

This commit is contained in:
Thomas Rudin 2020-01-03 13:43:36 +01:00
parent 6710c2875b
commit 8c0481ed5e
3 changed files with 201 additions and 197 deletions

View File

@ -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")

View File

@ -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

View File

@ -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
})