X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fextendtool.cpp;h=163729e297509db776b64366f5d358796f60c466;hb=7d6f95321585b41bb5a6f11ff148486612bbc19e;hp=021f184a8fb89a4393a9b8dfa6525691ad0da426;hpb=9e6dbfe685b1fb69b615acb1780fe20f6b2cef34;p=r2c2.git diff --git a/source/designer/extendtool.cpp b/source/designer/extendtool.cpp index 021f184..163729e 100644 --- a/source/designer/extendtool.cpp +++ b/source/designer/extendtool.cpp @@ -22,8 +22,8 @@ ExtendTool::ExtendTool(Designer &d, Input::Keyboard &k, Input::Mouse &m, const s if(unlinked_endpoints.empty()) { - done = true; set_status("No free endpoints"); + set_done(false); } const Catalogue::ObjectMap &object_types = designer.get_catalogue().get_all(); @@ -93,6 +93,7 @@ void ExtendTool::connect() if(!ok) { set_status("No aligned endpoints found"); + set_done(false); return; } @@ -101,6 +102,7 @@ void ExtendTool::connect() if(extend_tracks.empty()) { set_status("No connection possible"); + set_done(false); return; } @@ -162,9 +164,12 @@ void ExtendTool::pointer_motion() void ExtendTool::finish() { - for(vector::const_iterator i=unlinked_endpoints.begin(); i!=unlinked_endpoints.end(); ++i) - if(extend_tracks.front()->link_to(**i)) - break; + if(!extend_tracks.empty()) + { + for(vector::const_iterator i=unlinked_endpoints.begin(); i!=unlinked_endpoints.end(); ++i) + if(extend_tracks.front()->link_to(**i)) + break; + } } vector ExtendTool::create_straight(const Vector &start, const Angle &dir, float length, float limit)