Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2000:
[Freeciv-Dev] Re: Goto for airplanes
Home

[Freeciv-Dev] Re: Goto for airplanes

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Goto for airplanes
From: Thue Janus Kristensen <thue@xxxxxxx>
Date: Wed, 26 Apr 2000 17:58:32 +0200

On Tue, 25 Apr 2000, Jeff Mallatt wrote:
> 
> At 2000/04/20 19:02 , Thue Janus Kristensen wrote:
> >This patch makes airplanes on goto automatically use cities and airbases
> >as waypoints.
> 
> Your patch looks mostly good.  I've attached an updated patch with a few
> changes:
> 
> - Fixed several spelling errors in comments and freelog() calls.
> 
> - Renamed naive_can_move_between() to naive_air_can_move_between(), because
> it really only works for air units, right?

yep.
 
> - In do_unit_goto(), your patch changed the call to unit_list_find()
> (called after handle_unit_move_request() returns) to use punit->id, rather
> than the cached value thereof.  Unfortunately, handle_unit_move_request()
> can result in the punit unit being killed and wiped, and hence the pointer
> punit being no longer valid. (In fact, the call to unit_list_find() is for
> the purpose of determining that the punit unit has been killed.)  I changed
> it back to use a cached id value.

ups...

Here is yet another version. Changes:

replace the
while(1){ [...]
if (...) break
}
with a
do { [...] } while (...);
loop.

Remove the plusturns variable, which was used wrongly (the structure of
the refuel_index made it unneccesary). As the turns variable were not
used anyway this wasn't apparent in wrong gotos.

remove a few unneccesary calls to is_real_tile()

rearrenge/correct a few comments

-Thue

Attachment: airplane_goto-Apr-26.diff
Description: Text Data


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