X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fblock.cpp;h=03cb2dc3fa60c259f64590ed015a58f789c11c0f;hb=80e10207bee4d774f3015a5e946d463d2c828029;hp=a304a152d6959717e02badca31da10ef6f3cc65e;hpb=ae0600f7c3df5b6ef46992b1423888dd0e9a5026;p=r2c2.git diff --git a/source/libmarklin/block.cpp b/source/libmarklin/block.cpp index a304a15..03cb2dc 100644 --- a/source/libmarklin/block.cpp +++ b/source/libmarklin/block.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of the MSP Märklin suite -Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa +Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -38,7 +38,7 @@ Block::Block(TrafficManager &tm, Track &start): for(unsigned i=0; iget_sensor_id()==sensor_id) + if(links[i]->get_sensor_id()==sensor_id && !links[i]->get_turnout_id() && !track->get_turnout_id()) { queue.push_back(links[i]); tracks.insert(links[i]); @@ -100,11 +100,10 @@ int Block::traverse(unsigned epi, float *len) const return i; Track *next=track->get_link(other_ep); + if(tracks.count(next)==0) + return -1; track_ep=next->get_endpoint_by_link(*track); track=next; - - if(tracks.count(track)==0) - return -1; } }