void RouterPanel::goto_clicked()
{
goto_pick = true;
+ goto_target = 0;
signal_grab_pointer.emit();
}
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<const TrackChain *>(goto_target)));
}
}
map_coords_to_ancestor(rx, ry, *find_ancestor<GLtk::Root>());
Ray ray = engineer.get_main_view().create_ray(rx, ry);
Track *track = engineer.get_layout().pick<Track>(ray);
- if(track)
+ if(track && &track->get_block()!=goto_target)
{
goto_target = &track->get_block();
delete goto_highlight;