Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2005:
[Freeciv-Dev] (PR#14316) rewrite vision interface
Home

[Freeciv-Dev] (PR#14316) rewrite vision interface

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#14316) rewrite vision interface
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Oct 2005 15:58:00 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14316 >

A tiny bug in the patch causes watchtower vision to always be applied
once you've discovered the tech.  This patch fixes it.

-jason

Index: server/unittools.c
===================================================================
--- server/unittools.c  (revision 11131)
+++ server/unittools.c  (working copy)
@@ -3169,11 +3169,19 @@
   } /* end while */
 }
 
+/****************************************************************************
+  Return the vision the unit will have at the given tile.  The base vision
+  range may be modified by effects.
+
+  Note that vision MUST be independent of transported_by for this to work
+  properly.
+****************************************************************************/
 int get_unit_vision_at(struct unit *punit, struct tile *ptile)
 {
   int radius_sq = punit->type->vision_radius_sq;
 
   if (is_ground_unit(punit)
+      && tile_has_special(ptile, S_FORTRESS)
       && player_knows_techs_with_flag(unit_owner(punit), TF_WATCHTOWER)) {
     radius_sq += terrain_control.watchtower_extra_vision_radius_sq;
   }

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