+ if(target_speed && reserve_more()<2)
+ update_speed();
+
+ signal_route_changed.emit(route);
+}
+
+void Train::go_to(const Track &to)
+{
+ for(list<BlockRef>::const_iterator i=cur_blocks.begin(); i!=cur_blocks.end(); ++i)
+ if(i->block->get_tracks().count(const_cast<Track *>(&to)))
+ {
+ set_speed(0);
+ set_route(0);
+ return;
+ }
+
+ BlockRef *last = 0;
+ if(rsv_blocks.empty())
+ last = &cur_blocks.back();
+ else
+ {
+ for(list<BlockRef>::iterator i=rsv_blocks.begin(); (i!=rsv_blocks.end() && !last); ++i)
+ if(i->block->get_sensor_id())
+ last = &*i;
+ }
+
+ BlockRef next = last->next();
+ const Block::Endpoint &ep = next.block->get_endpoints()[next.entry];
+
+ set_route(Route::find(*ep.track, ep.track_ep, to));
+}
+
+void Train::place(Block &block, unsigned entry)
+{
+ if(target_speed)
+ set_speed(0);
+
+ release_blocks(rsv_blocks);
+ release_blocks(cur_blocks);
+
+ if(!block.reserve(this))