[Freeciv-Dev] Re: another vision range patch (PR#4674)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
After a quick glance at get_unit_vision_range:
1. The function is wrong, you must check for the S_FORTRESS at the
location.
2. It is at the server, which means the human auto-explorer will be
cheating: knowing where the watchtowers are in the unknown.
On Sun, 27 Jul 2003, Jason Short wrote:
>
> This much larger patch:
>
> - Adds get_unit_vision_range and get_unit_vision_range_at.
> - Removes unit_profits_of_watchtower and get_watchtower_vision.
> - Rewrites code to use the new functions.
> - Replaces old unit_type.vision_range calculations.
> - Fixes several unrelated bugs.
>
> The unrelated bugs actually look pretty severe. For instance when a
> watchtower is pillaged the server iterates over all units on the tile to
> update their vision. However it doesn't update the vision for the
> unit's owner's but rather for the pillaging unit's owner. In the rare
> case where these differ the results would likely be disasterous. This
> same type of bug occurs in several places.
>
> Nonetheless the correctness of this patch is not obvious and it should
> probably be broken up and the changes made piece-by-piece. I think
> vision_range-2.diff is a good start.
>
> An additional (dis)advantage is that the only assumption left is that
> only for fortresses will watchtower vision apply. Other arbitrary
> assumptions (like is_ground_unit()) are removed - giving more correct
> code but also some spurious fog/unfogs.
>
> Greg, Rafal?
>
> jason
>
>
>
>
- [Freeciv-Dev] Re: another vision range patch (PR#4674),
Gregory Berkolaiko <=
|
|