Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] another vision range patch (PR#4674)
Home

[Freeciv-Dev] another vision range patch (PR#4674)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bursig@xxxxxxxxx
Subject: [Freeciv-Dev] another vision range patch (PR#4674)
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 27 Jul 2003 22:58:44 -0700
Reply-to: rt@xxxxxxxxxxxxxx

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




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