Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2005:
[Freeciv-Dev] (PR#14295) desynchronized fog with loaded watchtower units
Home

[Freeciv-Dev] (PR#14295) desynchronized fog with loaded watchtower units

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#14295) desynchronized fog with loaded watchtower units
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 22 Oct 2005 15:58:23 -0700
Reply-to: bugs@xxxxxxxxxxx

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

> [jdorje - Thu Oct 13 06:06:56 2005]:
> 
> It looks to me like if you have a unit sitting on a watchtower, load it 
> directly into a transporter (via 'l', not by moving the cargo) and then 
> move the transporter, you will end up with desynchronized fog (in this 
> case permanently unfogged tiles).

This patch should fix it for 2.0.  For the development version this is
fixed already by the vision cleanup.

-jason

Index: server/unittools.c
===================================================================
--- server/unittools.c  (revision 11169)
+++ server/unittools.c  (working copy)
@@ -2664,7 +2664,13 @@
 
     /* Insert them again. */
     unit_list_iterate(cargo_units, pcargo) {
-      unfog_area(unit_owner(pcargo), pdesttile, 
unit_type(pcargo)->vision_range);
+      if (unit_profits_of_watchtower(pcargo)
+         && tile_has_special(pdesttile, S_FORTRESS)) {
+       unfog_area(unit_owner(pcargo), pdesttile,
+                  get_watchtower_vision(pcargo));
+      } else {
+       unfog_area(unit_owner(pcargo), pdesttile, 
unit_type(pcargo)->vision_range);
+      }
 
       /* Silently free orders since they won't be applicable anymore. */
       free_unit_orders(pcargo);
@@ -2674,7 +2680,14 @@
       unit_list_insert(&pdesttile->units, pcargo);
       check_unit_activity(pcargo);
       send_unit_info_to_onlookers(NULL, pcargo, psrctile, FALSE);
-      fog_area(unit_owner(pcargo), psrctile, unit_type(pcargo)->vision_range);
+      if (unit_profits_of_watchtower(pcargo)
+         && tile_has_special(psrctile, S_FORTRESS)) {
+       fog_area(unit_owner(pcargo), psrctile,
+                get_watchtower_vision(pcargo));
+      } else {
+       fog_area(unit_owner(pcargo), psrctile,
+                unit_type(pcargo)->vision_range);
+      }
       handle_unit_move_consequences(pcargo, psrctile, pdesttile);
     } unit_list_iterate_end;
     unit_list_unlink_all(&cargo_units);

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