Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#11373) Beta Crashing
Home

[Freeciv-Dev] Re: (PR#11373) Beta Crashing

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: wjb@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#11373) Beta Crashing
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Mon, 6 Dec 2004 16:55:48 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=11373 >

Marko Lindqvist wrote:
> 
> I'm already testing fix for this

  Ok, that bigger fix is going to be too big for S2_0 anyway so it 
should not hold back simple, and somewhat urgently needed, fix for stable.


  - ML


diff -Nurd -X.diff_ignore freeciv/server/unittools.c freeciv/server/unittools.c
--- freeciv/server/unittools.c  2004-12-07 01:27:32.093750000 +0200
+++ freeciv/server/unittools.c  2004-12-07 02:51:47.031250000 +0200
@@ -629,6 +629,9 @@
          unit_list_iterate(punit->tile->units,
                            punit2) {
            if (is_ground_unit(punit2)) {
+              /* Unfog (increase seen counter) first, fog (decrease counter)
+               * later, so tiles that are within vision range both before and
+               * after are not even temporarily marked fogged. */
              unfog_area(pplayer, punit2->tile,
                         unit_type(punit2)->vision_range);
              fog_area(pplayer, punit2->tile,
@@ -659,6 +662,9 @@
        freelog(LOG_VERBOSE, "Watchtower(2) pillaged!");
        unit_list_iterate(punit->tile->units, punit2) {
          if (is_ground_unit(punit2)) {
+            /* Unfog (increase seen counter) first, fog (decrease counter)
+             * later, so tiles that are within vision range both before and
+             * after are not even temporarily marked fogged. */
            unfog_area(pplayer, punit2->tile,
                       unit_type(punit2)->vision_range);
            fog_area(pplayer, punit2->tile,
@@ -695,10 +701,13 @@
       if (player_knows_techs_with_flag(pplayer, TF_WATCHTOWER)) {
        unit_list_iterate(ptile->units, punit) {
          if (is_ground_unit(punit)) {
-           fog_area(pplayer, punit->tile,
-                    unit_type(punit)->vision_range);
+            /* Unfog (increase seen counter) first, fog (decrease counter)
+             * later, so tiles that are within vision range both before and
+             * after are not even temporarily marked fogged. */
            unfog_area(pplayer, punit->tile,
                       get_watchtower_vision(punit));
+           fog_area(pplayer, punit->tile,
+                    unit_type(punit)->vision_range);
          }
        }
        unit_list_iterate_end;
@@ -1383,7 +1392,12 @@
 
   conn_list_do_buffer(&pplayer->connections);
 
-  /* apply new vision range */
+  /* Apply new vision range
+   *
+   * Unfog (increase seen counter) first, fog (decrease counter)
+   * later, so tiles that are within vision range both before and
+   * after are not even temporarily marked fogged. */
+
   if (map_has_special(punit->tile, S_FORTRESS)
       && unit_profits_of_watchtower(punit))
     unfog_area(pplayer, punit->tile, get_watchtower_vision(punit));

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