]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/block.cpp
More code for TrainProperties
[r2c2.git] / source / libmarklin / block.cpp
index f96e295a13a75f1962bfd149ccd59dbac41a3796..b3a96e67f4f59850c58a599c92eced8dc70d96c4 100644 (file)
@@ -93,7 +93,7 @@ const Block::Endpoint *Block::traverse(const Endpoint *ep) const
                        if(i->track==track && i->track_ep==other_ep)
                                return &*i;
 
-               track_ep=track->get_endpoint_by_link(other_ep->link);
+               track_ep=other_ep->link->get_endpoint_by_link(track);
                track=other_ep->link;
 
                if(tracks.count(track)==0)
@@ -122,6 +122,8 @@ bool Block::reserve(const Train *t)
        if(!t || !train)
        {
                train=t;
+               cout<<"Block "<<this<<" reserved for train "<<train<<'\n';
+               trfc_mgr.signal_block_reserved.emit(*this, train);
                return true;
        }
        else