mirror of
https://github.com/minetest-mods/technic.git
synced 2024-11-17 15:58:37 +01:00
provide "lag" info in switching station digiline response
This commit is contained in:
parent
4a6d6f6644
commit
7c0d0a2041
@ -85,7 +85,8 @@ minetest.register_node("technic:switching_station",{
|
|||||||
end
|
end
|
||||||
digilines.receptor_send(pos, technic.digilines.rules, channel, {
|
digilines.receptor_send(pos, technic.digilines.rules, channel, {
|
||||||
supply = meta:get_int("supply"),
|
supply = meta:get_int("supply"),
|
||||||
demand = meta:get_int("demand")
|
demand = meta:get_int("demand"),
|
||||||
|
lag = meta:get_int("lag")
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
@ -103,6 +103,9 @@ minetest.register_globalstep(function(dtime)
|
|||||||
|
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
|
-- set lag in microseconds into the "lag" meta field
|
||||||
|
meta:set_int("lag", switch_diff)
|
||||||
|
|
||||||
-- overload detection
|
-- overload detection
|
||||||
if switch_diff > 250000 then
|
if switch_diff > 250000 then
|
||||||
switch.skip = 30
|
switch.skip = 30
|
||||||
|
Loading…
Reference in New Issue
Block a user