update advtrains_line_automation
This commit is contained in:
parent
248722f401
commit
ad4c901937
@ -0,0 +1,11 @@
|
|||||||
|
minetest.register_craft({
|
||||||
|
type="shapeless",
|
||||||
|
output = 'advtrains_line_automation:dtrack_stop_placer',
|
||||||
|
recipe = {
|
||||||
|
"advtrains:dtrack_placer",
|
||||||
|
"technic:control_logic_unit",
|
||||||
|
"dye:black",
|
||||||
|
"dye:yellow",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
@ -21,6 +21,10 @@ if minetest.get_modpath("advtrains_interlocking") then
|
|||||||
dofile(MP.."/craft/advtrains_interlocking.lua")
|
dofile(MP.."/craft/advtrains_interlocking.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if minetest.get_modpath("advtrains_line_automation") then
|
||||||
|
dofile(MP.."/craft/advtrains_line_automation.lua")
|
||||||
|
end
|
||||||
|
|
||||||
if minetest.get_modpath("advtrains_luaautomation") then
|
if minetest.get_modpath("advtrains_luaautomation") then
|
||||||
dofile(MP.."/craft/advtrains_luaautomation.lua")
|
dofile(MP.."/craft/advtrains_luaautomation.lua")
|
||||||
end
|
end
|
||||||
|
@ -22,18 +22,6 @@ dofile(modpath.."railwaytime.lua")
|
|||||||
dofile(modpath.."scheduler.lua")
|
dofile(modpath.."scheduler.lua")
|
||||||
dofile(modpath.."stoprail.lua")
|
dofile(modpath.."stoprail.lua")
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type="shapeless",
|
|
||||||
output = 'advtrains_line_automation:dtrack_stop_placer',
|
|
||||||
recipe = {
|
|
||||||
"advtrains:dtrack_placer",
|
|
||||||
"technic:control_logic_unit",
|
|
||||||
"dye:black",
|
|
||||||
"dye:yellow",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function advtrains.lines.load(data)
|
function advtrains.lines.load(data)
|
||||||
if data then
|
if data then
|
||||||
|
@ -90,7 +90,7 @@ function sched.enqueue(rwtime, handler, evtdata, unitid, unitlim)
|
|||||||
ucn = (units_cnt[unitid] or 0)
|
ucn = (units_cnt[unitid] or 0)
|
||||||
local ulim=(unitlim or UNITS_THRESH)
|
local ulim=(unitlim or UNITS_THRESH)
|
||||||
if ucn >= ulim then
|
if ucn >= ulim then
|
||||||
atwarn("[lines][scheduler] discarding enqueue for",handler,"(limit",ulim,") because unit",unitid,"has already",ucn,"schedules enqueued")
|
atlog("[lines][scheduler] discarding enqueue for",handler,"(limit",ulim,") because unit",unitid,"has already",ucn,"schedules enqueued")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -118,10 +118,12 @@ end
|
|||||||
|
|
||||||
-- Discards all schedules for unit "unitid" (removes them from the queue)
|
-- Discards all schedules for unit "unitid" (removes them from the queue)
|
||||||
function sched.discard_all(unitid)
|
function sched.discard_all(unitid)
|
||||||
for i=1,#queue do
|
local i = 1
|
||||||
|
while i<=#queue do
|
||||||
if queue[i].u == unitid then
|
if queue[i].u == unitid then
|
||||||
table.remove(queue,i)
|
table.remove(queue,i)
|
||||||
i=i-1
|
else
|
||||||
|
i=i+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
units_cnt[unitid] = 0
|
units_cnt[unitid] = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user