Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] Re: (PR#717) WISHLIST: Goto cursor shows movecost
Home

[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]
To: sigra@xxxxxxx, stepan@xxxxxxxx, Brett.Albertson@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#717) WISHLIST: Goto cursor shows movecost
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Fri, 15 Aug 2003 07:41:55 -0700
Reply-to: rt@xxxxxxxxxxxxxx

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 ;)




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