Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2002:
[Freeciv-Dev] Re: movement
Home

[Freeciv-Dev] Re: movement

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: movement
From: Reinier Post <rp@xxxxxxxxxx>
Date: Wed, 14 Aug 2002 21:48:23 +0200

On Wed, Aug 14, 2002 at 03:54:36PM +0200, Raimar Falke wrote:

> The current try_move_unit
> 
> bool try_move_unit(struct unit *punit, int dest_x, int dest_y)
> {
>   if (myrand(1+map_move_cost(punit, dest_x, dest_y))>punit->moves_left &&
>       punit->moves_left<unit_move_rate(punit)) {
>     punit->moves_left=0;
>     send_unit_info(unit_owner(punit), punit);
>   }
>   return punit->moves_left > 0;
> }
> 
> is hard to read.

As a bystander, I spent some 30 minutes studying this code yesterday,
to see if I had an opinion on whether the change would be a good idea.
I gave up not because of try_move_unit() but because I didn't have
any idea if it was being called in the right places.  Someone suggested
it isn't being called when goto is used on units, but I couldn't
verify that.

The logic of movement seems to be spread around far too much.

-- 
Reinier


[Prev in Thread] Current Thread [Next in Thread]