X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrain.cpp;h=936f74aa82d6d522bb74a7d500a59eeecea0f2d2;hb=05afa986fa3d923a0ee239bb9200bdec7c6f1b5f;hp=f43969d1949b0729eed8ba9132fb1bb37125d23f;hpb=64340dad429ba4040538fc06b6882aabdb489925;p=r2c2.git diff --git a/source/libr2c2/train.cpp b/source/libr2c2/train.cpp index f43969d..936f74a 100644 --- a/source/libr2c2/train.cpp +++ b/source/libr2c2/train.cpp @@ -542,7 +542,7 @@ void Train::free_noncritical_blocks() } } -int Train::get_entry_to_block(Block &block) const +int Train::get_entry_to_block(const Block &block) const { for(BlockList::const_iterator i=blocks.begin(); i!=blocks.end(); ++i) if(i->block()==&block) @@ -1105,6 +1105,8 @@ void Train::check_turnout_paths(bool set) if(i==clear_blocks_end) ++clear_blocks_end; + if(i==cur_blocks_end && !(*i)->get_sensor_id()) + ++cur_blocks_end; } }