]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/blockallocator.cpp
Add driver for my custom Arduino-based control device
[r2c2.git] / source / libr2c2 / blockallocator.cpp
index 2e816775f7dfa7c86683a559e3f1f638e436b33f..e28558a7e0cd9e715e32722900dae39e544729b3 100644 (file)
@@ -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;
        }