[Freeciv-Dev] (PR#2690) [PATCH] Show unit location in its description
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
[jdorje - Sun Jan 12 09:10:20 2003]:
> [rfalke - Tue Jan 7 16:04:03 2003]:
>
> > On Fri, Jan 03, 2003 at 03:02:15AM -0800, Jason Short via RT wrote:
> > > Looping over every city to find the one closest to the unit is OK
given
> > > the current users of unit_description. But since the function is in
> >
> > > common/ the server might be tempted to use it, and that would be bad.
> >
> > The server already has his function:
> > server/unittools.c:get_location_str(). The question is now: it is
> > possible to merge/unify/whatever this function and
> > ai/aitools.c:dist_nearest_city and the new functions in
> > client/climisc.c?
>
> The AI's dist_nearest_city uses real_map_distance to find the "nearest"
> city. The unit description uses the pythagorean distance. Both are
> correct to do this, but unless we want to keep adding parameters to thee
> function (dist_nearest_city has a few) it makes it ugly to merge them.
On the other hand dist_nearest_city is not topology-safe (which I never
noticed before), and this would give a chance to fix it...
jason
|
|