[freeciv] try to fix the upstream patch

thomasj thomasj at fedoraproject.org
Mon Aug 30 19:19:45 UTC 2010


commit cc30536af56dc74d6e18478eccb0a1267c01cf45
Author: Thomas Janssen <thomasj at fedoraproject.org>
Date:   Mon Aug 30 21:19:43 2010 +0200

    try to fix the upstream patch

 stealth_fighter_fix-2.patch |   59 +++++++++++++++++++++----------------------
 1 files changed, 29 insertions(+), 30 deletions(-)
---
diff --git a/stealth_fighter_fix-2.patch b/stealth_fighter_fix-2.patch
index 70fde6d..8ecc551 100644
--- a/stealth_fighter_fix-2.patch
+++ b/stealth_fighter_fix-2.patch
@@ -1,6 +1,6 @@
---- server/maphand.c	(révision 17882)
-+++ server/maphand.c	(copie de travail)
-@@ -647,26 +647,26 @@
+--- server/maphand.c	2010-07-25 21:53:39.000000000 +0200
++++ server/maphand.c.old	2010-08-30 21:16:58.000000000 +0200
+@@ -635,33 +635,57 @@
    } players_iterate_end;
  }
  
@@ -24,23 +24,22 @@
  
      freelog(LOG_DEBUG, "Refogging circle at %d,%d from %d to %d",
 -	    TILE_XY(ptile), old_radius_sq, new_radius_sq);
-+            TILE_XY(ptile), old_radius_sq, new_radius_sq);
++	     TILE_XY(ptile), old_radius_sq, new_radius_sq);
  
      buffer_shared_vision(pplayer);
      circle_dxyr_iterate(ptile, max_radius, tile1, dx, dy, dr) {
        if (dr > old_radius_sq && dr <= new_radius_sq) {
 -	map_unfog_tile(pplayer, tile1, can_reveal_tiles, vlayer);
-+        map_unfog_tile(pplayer, tile1, can_reveal_tiles, vlayer);
++	 map_unfog_tile(pplayer, tile1, can_reveal_tiles, vlayer);
        } else if (dr > new_radius_sq && dr <= old_radius_sq) {
 -	map_fog_tile(pplayer, tile1, vlayer);
-+        map_fog_tile(pplayer, tile1, vlayer);
++	 map_fog_tile(pplayer, tile1, vlayer);
        }
      } circle_dxyr_iterate_end;
      unbuffer_shared_vision(pplayer);
-@@ -674,6 +674,30 @@
+   }
  }
- 
- /****************************************************************************
++/****************************************************************************
 +  There doesn't have to be a city.
 +  FIXME: results would be unexpected if the new_invis_radius_sq is bigger
 +  than new_main_radius_sq.
@@ -63,12 +62,13 @@
 +                          new_invis_radius_sq, can_reveal_tiles, V_INVIS);
 +  }
 +}
-+
+ 
+ /****************************************************************************
 +/****************************************************************************
    Shows the area to the player.  Unless the tile is "seen", it will remain
    fogged and units will be hidden.
  
-@@ -752,14 +776,16 @@
+@@ -740,14 +764,16 @@
          remove_dumb_city(pplayer, ptile);
  
          if (map_get_seen(ptile, pplayer, V_MAIN) > 0) {
@@ -88,7 +88,7 @@
          }
        }
  
-@@ -921,11 +947,14 @@
+@@ -909,11 +935,14 @@
  void map_clear_known(struct tile *ptile, struct player *pplayer)
  {
    BV_CLR(ptile->tile_known, player_index(pplayer));
@@ -105,7 +105,7 @@
  }
  
  /****************************************************************************
-@@ -1344,7 +1373,7 @@
+@@ -1332,7 +1361,7 @@
  	       player_name(pplayer),
  	       player_name(pplayer2));
  	whole_map_iterate(ptile) {
@@ -114,16 +114,16 @@
  	    int change = map_get_own_seen(ptile, pplayer, v);
  
  	    if (change > 0) {
-@@ -1352,7 +1381,7 @@
+@@ -1340,7 +1369,7 @@
  	      if (map_get_seen(ptile, pplayer2, v) == 0)
  		really_fog_tile(pplayer2, ptile, v);
  	    }
 -	  } vision_layer_iterate_end;
-+	  } vision_layer_reverse_iterate_end
++	  } vision_layer_reverse_iterate_end;
  	} whole_map_iterate_end;
        }
      } players_iterate_end;
-@@ -1621,27 +1650,18 @@
+@@ -1609,27 +1638,18 @@
    if (ploser != powner) {
      base_type_iterate(pbase) {
        if (tile_has_base(ptile, pbase)) {
@@ -162,7 +162,7 @@
          }
        }
      } base_type_iterate_end;
-@@ -1776,13 +1796,15 @@
+@@ -1764,13 +1784,15 @@
  
    See documentation in vision.h.
  ****************************************************************************/
@@ -183,7 +183,7 @@
  }
  
  /****************************************************************************
-@@ -1792,10 +1814,7 @@
+@@ -1780,10 +1802,7 @@
  ****************************************************************************/
  void vision_clear_sight(struct vision *vision)
  {
@@ -195,7 +195,7 @@
  }
  
  /****************************************************************************
-@@ -1815,15 +1834,17 @@
+@@ -1801,14 +1820,16 @@
        } else {
          struct player *owner = tile_owner(ptile);
  
@@ -206,6 +206,10 @@
            /* Base provides vision, but no borders. */
 -          map_refog_circle(owner, ptile, old_base->vision_main_sq, -1,
 -                           game.info.vision_reveal_tiles, V_MAIN);
+-        }
+-        if (old_base->vision_invis_sq >= 0 && owner) {
+-          map_refog_circle(owner, ptile, old_base->vision_invis_sq, -1,
+-                           game.info.vision_reveal_tiles, V_INVIS);
 +          map_refog_circle(owner, ptile,
 +                           0 <= old_base->vision_main_sq
 +                           ? old_base->vision_main_sq : -1, -1,
@@ -213,20 +217,19 @@
 +                           ? old_base->vision_invis_sq : -1, -1,
 +                           game.info.vision_reveal_tiles);
          }
--        if (old_base->vision_invis_sq >= 0 && owner) {
--          map_refog_circle(owner, ptile, old_base->vision_invis_sq, -1,
--                           game.info.vision_reveal_tiles, V_INVIS);
--        }
        }
        tile_remove_base(ptile, old_base);
-     }
-@@ -1850,13 +1871,15 @@
-   if (!done_new_vision) {
+@@ -1830,13 +1851,15 @@
+   } else {
      struct player *owner = tile_owner(ptile);
  
 -    if (pbase->vision_main_sq > 0 && owner) {
 -      map_refog_circle(owner, ptile, -1, pbase->vision_main_sq,
 -                       game.info.vision_reveal_tiles, V_MAIN);
+-    }
+-    if (pbase->vision_invis_sq > 0 && owner) {
+-      map_refog_circle(owner, ptile, -1, pbase->vision_invis_sq,
+-                       game.info.vision_reveal_tiles, V_INVIS);
 +    if (NULL != owner
 +        && (0 < pbase->vision_main_sq
 +            || 0 < pbase->vision_invis_sq)) {
@@ -237,9 +240,5 @@
 +                       ? pbase->vision_invis_sq : -1,
 +                       game.info.vision_reveal_tiles);
      }
--    if (pbase->vision_invis_sq > 0 && owner) {
--      map_refog_circle(owner, ptile, -1, pbase->vision_invis_sq,
--                       game.info.vision_reveal_tiles, V_INVIS);
--    }
    }
  }


More information about the scm-commits mailing list