Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2005:
[Freeciv-Dev] (PR#13539) Fix AI tile effect miscalculation
Home

[Freeciv-Dev] (PR#13539) Fix AI tile effect miscalculation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#13539) Fix AI tile effect miscalculation
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 25 Jul 2005 14:44:20 -0700
Reply-to: bugs@xxxxxxxxxxx

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

I don't think the problem is in the cache.  The attached patch adds an
assertion to check the cache validity, and this assertion never fails.

-jason

Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.358
diff -p -u -r1.358 city.c
--- common/city.c       24 Jul 2005 17:01:35 -0000      1.358
+++ common/city.c       25 Jul 2005 21:43:45 -0000
@@ -1537,6 +1537,9 @@ static inline void get_worked_tile_outpu
   city_map_iterate(x, y) {
     if (pcity->city_map[x][y] == C_TILE_WORKER) {
       output_type_iterate(o) {
+       assert(pcity->tile_output[x][y][o]
+              == base_city_get_output_tile(x, y, pcity,
+                                           base_city_celebrating(pcity), o));
        output[o] += pcity->tile_output[x][y][o];
       } output_type_iterate_end;
     }

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