If I ask the train manager to calculate the path for the train itself, it works fine:
Code: Select all
game.train_manager.request_train_path {
train = train,
goals = { { rail = train.path_end_rail, direction = 0 } },
}
But if I ask the same question from the very station that the train has just departed from (this is the station from the previous path that is 'path_end_station':
Code: Select all
game.train_manager.request_train_path {
starts = {
{
rail = train_info.current_station.connected_rail,
direction = defines.rail_direction.front,
},
{
rail = train_info.current_station.connected_rail,
direction = defines.rail_direction.back,
},
},
goals = { { rail = train.path_end_rail, direction = 0 } },
}
No matter what combination (rail or station) for the starts and goals I use, the train manager does not find a path between the two stations when called from a mod. steps_limit or shortest_path makes no difference. It works fine when the source is a train but not when given starts.