[Freeciv-Dev] Re: (PR#9942) planned unit movement
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9942 >
Guest wrote:
> Do you really suggest to remove that pretty packet conversion?
> +/**************************************************************************
> +Creates a packet_goto_route according to packet_move_unit
> +**************************************************************************/
> +struct packet_goto_route *create_packet_goto_route(struct packet_move_unit
> *pmove)
> +{
> + int num_valid = 1;
> + struct packet_goto_route *packet;
> +
> + packet = fc_malloc(sizeof(struct packet_goto_route));
> + packet->unit_id = pmove->unid;
> + packet->pos = fc_malloc((num_valid+1) * sizeof(struct map_position));
> + packet->length = num_valid + 1;
> + packet->first_index = 0;
> + packet->last_index = num_valid;
> +
> + packet->pos[0].x = pmove->x;
> + packet->pos[0].y = pmove->y;
> +
> + return packet;
Absolutely. You can instead create a send_move_as_orders() function at
the client if you want. IIRC the client already has a check to use
orders if the unit is out of MP.
jason
|
|