]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/train.cpp
Add a utility function to get path length from Track
[r2c2.git] / source / libr2c2 / train.cpp
index 07461b80a9558ecc4000c176bf73565e4c6d922b..7e4a6904610a7b51ee19940e7f4d9cc1812f95aa 100644 (file)
@@ -530,14 +530,14 @@ float Train::get_reserved_distance_until(const Block *until_block) const
        if(reverse)
                track = track.reverse();
        else
-               result = track->get_type().get_path_length(track->get_active_path())-result;
+               result = track->get_path_length()-result;
        result -= veh.get_type().get_length()/2;
 
        BlockIter block = track.block_iter();
 
        // Count remaining distance in the vehicle's current block
        for(track=track.next(); &track->get_block()==&*block; track=track.next())
-               result += track->get_type().get_path_length(track->get_active_path());
+               result += track->get_path_length();
 
        const BlockIter &last = allocator.last();
        if(&*block==&*last)