X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Frouterpanel.cpp;h=30857ceb7f9b0980de21ed0fce8e6fcc4b5493ef;hb=d990c03a06a494ce3596862ce61e2a5684dea7e1;hp=11056ea85f28e578c58bbd20b1b65045b1fa669b;hpb=0d95d81bd2165d5b7e70d7e659b7806eb9cbba7e;p=r2c2.git diff --git a/source/engineer/routerpanel.cpp b/source/engineer/routerpanel.cpp index 11056ea..30857ce 100644 --- a/source/engineer/routerpanel.cpp +++ b/source/engineer/routerpanel.cpp @@ -78,6 +78,7 @@ void RouterPanel::route_selected(unsigned index) void RouterPanel::goto_clicked() { goto_pick = true; + goto_target = 0; signal_grab_pointer.emit(); } @@ -94,7 +95,7 @@ void RouterPanel::button_press(int x, int y, unsigned btn) goto_highlight = 0; if(goto_target && btn==1) - train.ai_message(TrainAI::Message("set-destination-block", goto_target)); + train.ai_message(TrainAI::Message("set-destination", static_cast(goto_target))); } } @@ -109,7 +110,7 @@ void RouterPanel::pointer_motion(int x, int y) map_coords_to_ancestor(rx, ry, *find_ancestor()); Ray ray = engineer.get_main_view().create_ray(rx, ry); Track *track = engineer.get_layout().pick(ray); - if(track) + if(track && &track->get_block()!=goto_target) { goto_target = &track->get_block(); delete goto_highlight;