[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]
[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.
jason
|
|