[freeciv-ai] Re: (PR#3619) coordinate fix in find_city_to_diplomat
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Quoting Jason Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>:
> [rwetmore@xxxxxxxxxxxx - Sat Mar 8 13:12:52 2003]:
> > Per has the right understanding. The value does not need to be
> > an upper bound on any map distance. It may in fact make more
> > sense to limit it to 10 or 20 moves, i.e. a reasonable range
> > the diplomat can reach in reasonable time.
> > But Jason is right in that it mixes coordinate concepts. For
> > this it should at least have a comment that explains why it
> > doesn't matter in this case.
> Exactly. But, in this case the use of map.*size is completely
> unnecessary; it is just noise. The attached patch (updated for PF)
> removes this.
While Jason'spatch is perfectly correct, it drew my attention to another
suspicious place: the code seems to look for the _closest_ diplomatable city
(this is not proclaimed but this is what is done). And by the definition of
PF-iteration, the first city to be discovered is the closest one.
So we might as well put a big "return" after
*move_dist = pos.total_MC;