Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: (PR#4674) small clean up in unit vision range calculat
Home

[Freeciv-Dev] Re: (PR#4674) small clean up in unit vision range calculat

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bursig@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4674) small clean up in unit vision range calculations
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Jul 2003 06:36:46 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Gregory Berkolaiko wrote:
> On Thu, 24 Jul 2003, Rafa? Bursig wrote:
> 
> 
>>This is small clean up that remove some duplicate code.
> 
> 
> While in principle the changes are good, I think you should
> (1) Retire unit_profits_of_watchtower and get_watchtower_vision
> altogether
> (2) Leave ai/aiunit.c as it is.  We intentionally ignore watchtower there, 
> because we need the range at (x,y) and not at the present location of the 
> unit.  You can add a comment there, though.  So other people don't get 
> tempted to "fix" it.

While in principle I agree with you, unit_profits_of_watchtower and 
get_watchtower_vision are somewhat needed for when we need to consider 
the vision of a unit at a position other than its current one.  They are 
used in several places in unithand.c this way.

On a related note, ai/aiunit.c should probably use them.

I would suggest replacing them with unit_vision_range_at(punit, x, y).

jason




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