Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2006:
[Freeciv-Dev] (PR#18725) [Patch] Don't use city warmap for unit
Home

[Freeciv-Dev] (PR#18725) [Patch] Don't use city warmap for unit

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#18725) [Patch] Don't use city warmap for unit
From: "Marko Lindqvist" <cazfi74@xxxxxxxxx>
Date: Wed, 19 Jul 2006 13:38:39 -0700
Reply-to: bugs@xxxxxxxxxxx

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


  Warmaps generated for units and cities are substantially different. 
Currently city warmap is sometimes used for unit as cached value. I 
don't think saved CPU cycles are worth the inaccuracy. This is not bad 
only for unit, but it seems that city warmap itself is compromise 
between (defensive) city warmap and (offensive) unit warmap.
  With attached patch city warmap is never used for unit.


  - ML

diff -Nurd -X.diff_ignore freeciv/server/gotohand.c freeciv/server/gotohand.c
--- freeciv/server/gotohand.c   2006-07-19 22:10:52.012149800 +0300
+++ freeciv/server/gotohand.c   2006-07-19 23:26:45.699649800 +0300
@@ -393,14 +393,6 @@
 
   if (punit) {
     /* 
-     * Checking for an existing warmap. If the previous warmap was for
-     * a city and our unit is in that city, use city's warmap.
-     */
-    if (pcity && pcity == warmap.warcity) {
-      return;
-    }
-
-    /* 
      * If the previous warmap was for the same unit and it's still
      * correct (warmap.(sea)cost[x][y] == 0), reuse it.
      */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#18725) [Patch] Don't use city warmap for unit, Marko Lindqvist <=