What could cause this?
Bug: yellow lamp but no trains assigned
Moderator: Optera
Re: Bug: yellow lamp but no trains assigned
This bug should have been fixed a few versions ago.
If you are still having it in 1.7.2 please enable debug logging and attach factorio-current.log.
If you are still having it in 1.7.2 please enable debug logging and attach factorio-current.log.
My Mods: mods.factorio.com
Re: Bug: yellow lamp but no trains assigned
Yes, the latest version. I debugged it and discovered that there is no such train scheduled. I think that the lamp color is not changed or delivery not removed from stop personal list when delivery is removed without train reaching station like timeout.
Re: Bug: yellow lamp but no trains assigned
Just discovered that it's not an indication issue. Somehow (perhaps because of renaming with duplicating names) a lot of my stations had extra entries in stop.activeDeliveries. I fixed it by adding this to the end of UpdateStop
WIll you consider including it into the mod?
Code: Select all
local name = stop.entity.backer_name
local removed = false
for i=#stop.activeDeliveries, 1, -1 do
local d = global.Dispatcher.Deliveries[stop.activeDeliveries[i]]
if (not d) or ((d.from~=name) and (d.to~=name)) then
if message_level >= 1 then printmsg("Found missing delivery on station "..stop.entity.backer_name) end
log("Found missing delivery on station "..stop.entity.backer_name)
table.remove(stop.activeDeliveries,i)
removed = true
end
end
if removed and stop.errorCode == 0 then
if #stop.activeDeliveries > 0 then
setLamp(stopID, "yellow", #stop.activeDeliveries)
else
setLamp(stopID, "green", 1)
end
end
Re: Bug: yellow lamp but no trains assigned
I removed something similar to this in 1.6 since i couldn't find a way to reproduce orphaned stop.activeDeliveries.
Instead of adding an extra loop to each stop update I'm more curious on how exactly you managed to produce this state so i can prevent it in the first place.
Instead of adding an extra loop to each stop update I'm more curious on how exactly you managed to produce this state so i can prevent it in the first place.
My Mods: mods.factorio.com
Re: Bug: yellow lamp but no trains assigned
This code prints a message immediately in such cases so I will let you know if I see it after some action.
Re: Bug: yellow lamp but no trains assigned
I forgot to mention, the original fail safe code is only commented out from lines 1356 to 1360. https://github.com/Yousei9/Logistic-Tra ... .lua#L1355
My Mods: mods.factorio.com