[Freeciv-Dev] (PR#14316) rewrite vision interface
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<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;
}
|
|