provide "lag" info in switching station digiline response

This commit is contained in:
BuckarooBanzay 2020-06-18 10:59:40 +02:00
parent 4a6d6f6644
commit 7c0d0a2041
2 changed files with 5 additions and 1 deletions

View File

@ -85,7 +85,8 @@ minetest.register_node("technic:switching_station",{
end
digilines.receptor_send(pos, technic.digilines.rules, channel, {
supply = meta:get_int("supply"),
demand = meta:get_int("demand")
demand = meta:get_int("demand"),
lag = meta:get_int("lag")
})
end
},

View File

@ -103,6 +103,9 @@ minetest.register_globalstep(function(dtime)
local meta = minetest.get_meta(pos)
-- set lag in microseconds into the "lag" meta field
meta:set_int("lag", switch_diff)
-- overload detection
if switch_diff > 250000 then
switch.skip = 30