Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: [PATCH] Cleaned up magic code ingotohand.c (PR#944)
Home

[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]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Cleaned up magic code ingotohand.c (PR#944)
From: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Date: Mon, 10 Sep 2001 06:03:41 -0400
Reply-to: jdorje@xxxxxxxxxxxxxxxxxxxxx

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


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