X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fblockallocator.cpp;h=e28558a7e0cd9e715e32722900dae39e544729b3;hb=8a31a3ab3ab7abda30de0ed3a6d0753760f3bb1d;hp=2e816775f7dfa7c86683a559e3f1f638e436b33f;hpb=d051af7264ee62d03473f1929414e262e918c30a;p=r2c2.git diff --git a/source/libr2c2/blockallocator.cpp b/source/libr2c2/blockallocator.cpp index 2e81677..e28558a 100644 --- a/source/libr2c2/blockallocator.cpp +++ b/source/libr2c2/blockallocator.cpp @@ -28,6 +28,7 @@ struct BlockAllocator::BlockMatch BlockAllocator::BlockAllocator(Train &t): train(t), + active(false), cur_blocks_end(blocks.end()), next_sensor(0), pending_block(0), @@ -79,7 +80,7 @@ bool BlockAllocator::start_from(const BlockIter &block) break; blocks_to_reserve.push_back(b); for(TrackIter t=b.track_iter(); (t && &t->get_block()==&*b); t=t.next()) - remaining_length -= t->get_type().get_path_length(t->get_active_path()); + remaining_length -= t->get_path_length(); if(remaining_length<=0) break; }