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