X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fmanipulator.cpp;h=c103314564a69daead55d65c255382681819b3e1;hb=c06f3dde10411cd34aae026d8bf22b7771bdc3e0;hp=204226e42fb029480cda3d7371649dc718b934e9;hpb=d15ac13f2e170f155b4bbd124df48400c339b644;p=r2c2.git diff --git a/source/designer/manipulator.cpp b/source/designer/manipulator.cpp index 204226e..c103314 100644 --- a/source/designer/manipulator.cpp +++ b/source/designer/manipulator.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include "libr2c2/tracktype.h" #include "designer.h" #include "manipulator.h" @@ -646,11 +646,7 @@ vector Manipulator::create_straight(const R2C2::Vector &start, float di float s = sin(dir); for(vector::iterator i=lengths.begin(); i!=lengths.end(); ++i) { - map::iterator j = types_by_length.find(*i); - if(j==types_by_length.end()) - throw LogicError("Internal error"); - - Track *track = new Track(designer.get_layout(), *j->second); + Track *track = new Track(designer.get_layout(), *get_item(types_by_length, *i)); track->set_position(pos); track->set_rotation(dir);