Calling stop_at(0) causes the block allocator to immediately resume
allocating blocks. In certain circumstances this would cause an
allocation past the end of the route.
{
// We are not at the end of the route now, but might have been before.
arrival = ON_THE_WAY;
{
// We are not at the end of the route now, but might have been before.
arrival = ON_THE_WAY;
train.refresh_blocks_from(*fncb);
train.refresh_blocks_from(*fncb);
+ if(!arrival)
+ train.stop_at(0);