]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/train.cpp
Mark turnout blocks before the next sensor as current
[r2c2.git] / source / libr2c2 / train.cpp
index f43969d1949b0729eed8ba9132fb1bb37125d23f..936f74aa82d6d522bb74a7d500a59eeecea0f2d2 100644 (file)
@@ -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;
        }
 }