Index: server/unithand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/unithand.c,v retrieving revision 1.227 diff -u -r1.227 unithand.c --- server/unithand.c 2002/07/14 13:40:27 1.227 +++ server/unithand.c 2002/07/17 18:11:57 @@ -66,18 +66,10 @@ { struct unit *punit = player_find_unit_by_id(pplayer, req->unit_id); - /* - * Discard invalid packet. Replace this with is_normal_map_pos if - * 1.13.1-devel is started. - */ - if (!normalize_map_pos(&req->x, &req->y)) { + if (!is_normal_map_pos(req->x, req->y) || !punit) { return; } - if(!punit) { - return; - } - punit->goto_dest_x = req->x; punit->goto_dest_y = req->y; @@ -106,11 +98,7 @@ struct unit *punit = player_find_unit_by_id(pplayer, req->unit_id); struct city *pcity; - /* - * Discard invalid packet. Replace this with is_normal_map_pos if - * 1.13.1-devel is started. - */ - if (!normalize_map_pos(&req->x, &req->y)) { + if (!is_normal_map_pos(req->x, req->y)) { return; } @@ -129,16 +117,9 @@ struct packet_unit_connect *req) { struct unit *punit = player_find_unit_by_id(pplayer, req->unit_id); - - /* - * Discard invalid packet. Replace this with is_normal_map_pos if - * 1.13.1-devel is started. - */ - if (!normalize_map_pos(&req->dest_x, &req->dest_y)) { - return; - } - if (!punit || !can_unit_do_connect(punit, req->activity_type)) { + if (!is_normal_map_pos(req->dest_x, req->dest_y) || !punit + || !can_unit_do_connect(punit, req->activity_type)) { return; } @@ -592,19 +573,11 @@ { struct unit *punit = player_find_unit_by_id(pplayer, pinfo->id); - if (!punit) { + if (!punit || !is_normal_map_pos(pinfo->x, pinfo->y)) { return; } if (!same_pos(punit->x, punit->y, pinfo->x, pinfo->y)) { - /* - * Discard invalid packet. Replace this with is_normal_map_pos if - * 1.13.1-devel is started. - */ - if (!normalize_map_pos(&pinfo->x, &pinfo->y)) { - return; - } - if (is_tiles_adjacent(punit->x, punit->y, pinfo->x, pinfo->y)) { punit->ai.control = FALSE; handle_unit_move_request(punit, pinfo->x, pinfo->y, FALSE, FALSE); @@ -633,16 +606,9 @@ void handle_move_unit(struct player *pplayer, struct packet_move_unit *pmove) { struct unit *punit = player_find_unit_by_id(pplayer, pmove->unid); - - /* - * Discard invalid packet. Replace this with is_normal_map_pos if - * 1.13.1-devel is started. - */ - if (!normalize_map_pos(&pmove->x, &pmove->y)) { - return; - } - if (!punit || !is_tiles_adjacent(punit->x, punit->y, pmove->x, pmove->y)) { + if (!is_normal_map_pos(pmove->x, pmove->y) || !punit + || !is_tiles_adjacent(punit->x, punit->y, pmove->x, pmove->y)) { return; } handle_unit_move_request(punit, pmove->x, pmove->y, FALSE, FALSE); @@ -906,11 +872,7 @@ return FALSE; } - /* - * Discard invalid packet. Replace this with is_normal_map_pos if - * 1.13.1-devel is started. - */ - if (!normalize_map_pos(&dest_x, &dest_y)) { + if (!is_normal_map_pos(dest_x, dest_y)) { return FALSE; }