X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fblock.cpp;h=1519401220edf59481427c68621985c0cf528f69;hb=9b536a7197c424c3fa3809063c56da324b56dab2;hp=b9b65ad710dca9dd833177ee993b31562c3c4b5b;hpb=c400ed779704cc802de977090594c3441c3e7093;p=r2c2.git diff --git a/source/libmarklin/block.cpp b/source/libmarklin/block.cpp index b9b65ad..1519401 100644 --- a/source/libmarklin/block.cpp +++ b/source/libmarklin/block.cpp @@ -103,12 +103,7 @@ float Block::get_path_length(unsigned entry, const Route *route) const float result = 0; while(t_iter && has_track(*t_iter)) { - int path = -1; - if(t_iter->get_turnout_id() && route) - path = route->get_turnout(t_iter->get_turnout_id()); - if(path==-1) - path = t_iter->get_active_path(); - + unsigned path = (route ? route->get_path(*t_iter) : t_iter->get_active_path()); result += t_iter->get_type().get_path_length(path); t_iter = t_iter.next(path);