Unified Train Logistics


Train dispatcher: providers, requesters, depots, fuel stations, cleanup and manager in one mod – built for high UPS.

Content
7 days ago
2.1
114
Logistics Trains Fluids Circuit network

b Station without rail crash

9 days ago
(updated 9 days ago)

When placing a blueprint the (presumably) requester station was placed before the rail was, and results in:

Error while running event UTLogistics::on_train_changed_state (ID 31)
Given train stop is not connected to any rails, cannot be used as a target
stack traceback:
    [C]: in function 'request_train_path'
    __UTLogistics__/scripts/dispatcher/reach.lua:73: in function 'check'
    __UTLogistics__/scripts/dispatcher/dispatch.lua:164: in function 'chain'
    __UTLogistics__/scripts/trains/init.lua:82: in function 'fn'
    __UTLogistics__/scripts/core/perf.lua:19: in function 'measure'
    __UTLogistics__/scripts/trains/init.lua:115: in function
    <__UTLogistics__/scripts/trains/init.lua:113>
9 days ago
(updated 9 days ago)

I did a quick fix by adding a bailout-check to return false from Reach.check if not stop.valid or not stop.connected_rail

You'd probably want to check the stop has rail connected before even getting to this point though, so it's not even considered as part of the UTL network.

9 days ago

Thanks for the report and the trace! Fixed in 0.0.15: train stops without a connected rail are no longer used as a target (requesters, providers, depots, fuel and cleanup stations) until a rail is attached, so placing a blueprint where the stop comes before the rail no longer crashes. You can remove your quick fix after updating. The map setting "Debug log" now also writes a line when a train stop has no rail, in case something similar shows up again.

New response