[Freeciv-Dev] Re: [PATCH] Cleaned up magic code ingotohand.c (PR#944)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
<snip different implementations of straightest_direction()>
> You have here flexibility which you should give to your caller. The
> caller may want to move at the edge of known-unknown area or may want
> to prefer safer route.
This flexibility already exists.
Straightest_direction only returns the _straightest_ direction from
point A to point B. The calling code takes care of other issues (such
as travel time and impassible routes, which s_d() knows nothing about).
I assume the calling code assembles a list of viable directions, then
calls straightest_direction to try to pick one.
The problem, really, is that straightest_direction is wrong. It does
not return the straightest direction in many cases. But, since the
calling code will only pick between equally valid directions anyway,
this doesn't matter (except that it's ugly to always have weird diagonal
goto routes, and denies the usefulness of the function in the first
place).
jason
|
|