diff -udarbB -X freeciv/diff_ignore freeciv/client/civclient.c freeciv.mod/client/civclient.c --- freeciv/client/civclient.c Sun Jan 7 14:09:56 2001 +++ freeciv.mod/client/civclient.c Sat Jan 13 00:36:41 2001 @@ -425,6 +425,20 @@ /************************************************************************** ... **************************************************************************/ +void send_goto_unit(struct unit *punit,int dest_x,int dest_y) +{ + struct packet_unit_request req; + + req.unit_id=punit->id; + req.name[0]='\0'; + req.x=dest_x; + req.y=dest_y; + send_packet_unit_request(&aconnection, &req, PACKET_UNIT_GOTO_TILE); +} + +/************************************************************************** +... +**************************************************************************/ void send_report_request(enum report_type type) { struct packet_generic_integer pa; diff -udarbB -X freeciv/diff_ignore freeciv/client/civclient.h freeciv.mod/client/civclient.h --- freeciv/client/civclient.h Wed Aug 9 15:11:38 2000 +++ freeciv.mod/client/civclient.h Sat Jan 13 00:40:25 2001 @@ -20,6 +20,7 @@ void send_unit_info(struct unit *punit); void send_move_unit(struct unit *punit); +void send_goto_unit(struct unit *punit,int dest_x,int dest_y); void send_report_request(enum report_type type); void user_ended_turn(void); diff -udarbB -X freeciv/diff_ignore freeciv/client/control.c freeciv.mod/client/control.c --- freeciv/client/control.c Sat Oct 28 00:19:59 2000 +++ freeciv.mod/client/control.c Sat Jan 13 00:36:05 2001 @@ -931,22 +931,12 @@ if (punit) { if (is_air_unit(punit)) { - struct packet_unit_request req; - req.unit_id = punit->id; - req.name[0] = '\0'; - req.x = xtile; - req.y = ytile; - send_packet_unit_request(&aconnection, &req, PACKET_UNIT_GOTO_TILE); + send_goto_unit(punit,xtile,ytile); } else if (transfer_route_to_stack(xtile, ytile)) { if (has_capability("activity_patrol", aconnection.capability)) { goto_array_send(punit); } else { - struct packet_unit_request req; - req.unit_id=punit->id; - req.name[0]='\0'; - req.x = xtile; - req.y = ytile; - send_packet_unit_request(&aconnection, &req, PACKET_UNIT_GOTO_TILE); + send_goto_unit(punit,xtile,ytile); } } else { append_output_window(_("Game: Didn't find a route to the destination!")); diff -udarbB -X freeciv/diff_ignore freeciv/client/gui-gtk/gotodlg.c freeciv.mod/client/gui-gtk/gotodlg.c --- freeciv/client/gui-gtk/gotodlg.c Sun Jan 2 12:55:26 2000 +++ freeciv.mod/client/gui-gtk/gotodlg.c Sat Jan 13 00:36:05 2001 @@ -274,12 +274,7 @@ if(pdestcity) { struct unit *punit=get_unit_in_focus(); if(punit) { - struct packet_unit_request req; - req.unit_id=punit->id; - req.name[0]='\0'; - req.x=pdestcity->x; - req.y=pdestcity->y; - send_packet_unit_request(&aconnection, &req, PACKET_UNIT_GOTO_TILE); + send_goto_unit(punit,pdestcity->x,pdestcity->y); } } popdown_goto_dialog(); diff -udarbB -X freeciv/diff_ignore freeciv/client/gui-mui/gotodlg.c freeciv.mod/client/gui-mui/gotodlg.c --- freeciv/client/gui-mui/gotodlg.c Fri Sep 1 15:34:35 2000 +++ freeciv.mod/client/gui-mui/gotodlg.c Sat Jan 13 00:36:05 2001 @@ -99,12 +99,7 @@ struct unit *punit = get_unit_in_focus(); if (punit) { - struct packet_unit_request req; - req.unit_id = punit->id; - req.name[0] = '\0'; - req.x = pcity->x; - req.y = pcity->y; - send_packet_unit_request(&aconnection, &req, PACKET_UNIT_GOTO_TILE); + send_goto_unit(punit,pcity->x,pcity->y); } } set(goto_wnd, MUIA_Window_Open, FALSE); diff -udarbB -X freeciv/diff_ignore freeciv/client/gui-mui/mapclass.c freeciv.mod/client/gui-mui/mapclass.c --- freeciv/client/gui-mui/mapclass.c Mon Jan 1 20:40:00 2001 +++ freeciv.mod/client/gui-mui/mapclass.c Sat Jan 13 00:36:05 2001 @@ -91,12 +91,7 @@ *****************************************************************/ void request_unit_goto_location(struct unit *punit, int x, int y) { - struct packet_unit_request req; - req.unit_id = punit->id; - req.name[0] = '\0'; - req.x = x; - req.y = y; - send_packet_unit_request(&aconnection, &req, PACKET_UNIT_GOTO_TILE); + send_goto_unit(punit,x,y); } /************************************************************************** diff -udarbB -X freeciv/diff_ignore freeciv/client/gui-xaw/gotodlg.c freeciv.mod/client/gui-xaw/gotodlg.c --- freeciv/client/gui-xaw/gotodlg.c Thu Aug 10 22:25:52 2000 +++ freeciv.mod/client/gui-xaw/gotodlg.c Sat Jan 13 00:36:05 2001 @@ -308,12 +308,7 @@ if(pdestcity) { struct unit *punit=get_unit_in_focus(); if(punit) { - struct packet_unit_request req; - req.unit_id=punit->id; - req.name[0]='\0'; - req.x=pdestcity->x; - req.y=pdestcity->y; - send_packet_unit_request(&aconnection, &req, PACKET_UNIT_GOTO_TILE); + send_goto_unit(punit,pcity->x,pcity->y); } } popdown_goto_dialog();