]> git.tdb.fi Git - r2c2.git/commitdiff
Properly detect blocks as critical when a train is not moving
authorMikko Rasa <tdb@tdb.fi>
Tue, 23 Jul 2013 13:43:20 +0000 (16:43 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 23 Jul 2013 13:43:20 +0000 (16:43 +0300)
source/libr2c2/train.cpp

index 9cb032ec3f4a9a5663eece64a3048b76a103c10e..285a15a27fb83794bcffa9406c144b416e1d0079 100644 (file)
@@ -222,7 +222,7 @@ void Train::stop_at(Block *block)
 
 bool Train::is_block_critical(const Block &block) const
 {
-       return get_reserved_distance_until(&block)<controller->get_braking_distance()*1.3;
+       return get_reserved_distance_until(&block)<=controller->get_braking_distance()*1.3;
 }
 
 BlockIter Train::get_first_noncritical_block() const