[Freeciv-Dev] Re: (PR#717) WISHLIST: Goto cursor shows movecost
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, 15 Aug 2003, Jason Short wrote:
> Gregory Berkolaiko wrote:
> >
> > int get_length(void)
> > {
> > int i, time = 0;
> >
> > for(i = 0; i < goto_map.num_parts; i++) {
> > time += goto_map.parts[goto_map.num_parts - 1].time;
> > }
> >
> > return time;
> > }
> >
> > should do the trick imo.
>
> Indeed. Of course PF is cleverer than I had thought...
I think on this occasion the fame is slightly mis-attributed.
Anyway, there is one point which I think we should change:
if a unit can reach a location within the current turn but will have no
moves remaining, the number of turns displayed will be 1. This is how PF
stores information but it's more logical for the humans to see 0 here.
So I guess we should add
if (pf_last_position(p->path)->moves_left == goto_map.full_moves
&& time > 0) {
time--;
}
before
return time;
in the above function. And then make it compile ;)
[Freeciv-Dev] Re: (PR#717) WISHLIST: Goto cursor shows movecost, Gregory Berkolaiko, 2003/08/15
[Freeciv-Dev] Re: (PR#717) WISHLIST: Goto cursor shows movecost, John Wheeler, 2003/08/15
|
|