From: Mikko Rasa Date: Tue, 23 Jul 2013 13:43:20 +0000 (+0300) Subject: Properly detect blocks as critical when a train is not moving X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d41f66805bc9fe0b33e3d46b47f52e67b5782028;p=r2c2.git Properly detect blocks as critical when a train is not moving --- diff --git a/source/libr2c2/train.cpp b/source/libr2c2/train.cpp index 9cb032e..285a15a 100644 --- a/source/libr2c2/train.cpp +++ b/source/libr2c2/train.cpp @@ -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)get_braking_distance()*1.3; + return get_reserved_distance_until(&block)<=controller->get_braking_distance()*1.3; } BlockIter Train::get_first_noncritical_block() const