Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] Re: (PR#12498) bug in saved games in latest cvs version (M
Home

[Freeciv-Dev] Re: (PR#12498) bug in saved games in latest cvs version (M

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: xbertje@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12498) bug in saved games in latest cvs version (March 12, 2005)
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 14 Mar 2005 08:57:53 -0800
Reply-to: bugs@xxxxxxxxxxx

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

Bert Bert wrote:

> If I reload saved games after a server crash, then I find that
> several of the last saved games do not load, but crash with
> the following error message:
> 
> This is the server for Freeciv version 2.0.99-devel
> You can learn a lot about Freeciv at http://www.freeciv.org/
> 2: Loading rulesets
> civserver: distribute.c:118: distribute: Assertion `number == 0' failed.
> Aborted

This is an annoying, ugly bug in savegame loading.

The core problem is that generic_city_refresh has only one boolean 
parameter not two.  This controls whether a recursive refresh is done 
and also if a full refresh is done.  Currently when the refresh recurses 
this is set to FALSE to avoid future recursions.

However this makes loading a saved game impossible.  We can't call gcr 
with the value FALSE because we need a full city refresh.  But if we 
call it with TRUE then we get recursion which doesn't do a full city 
refresh.

This patch causes the recursive gcr call to have TRUE.  This means 
double-recursion is possible (but shouldn't happen since recursion is 
only done when the base trade changes).

-jason

? foo
Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.317
diff -u -r1.317 city.c
--- common/city.c       8 Mar 2005 00:43:26 -0000       1.317
+++ common/city.c       14 Mar 2005 16:54:47 -0000
@@ -2290,7 +2290,7 @@
       struct city *pcity2 = find_city_by_id(pcity->trade[i]);
 
       if (pcity2) {
-       generic_city_refresh(pcity2, FALSE, send_unit_info);
+       generic_city_refresh(pcity2, TRUE, send_unit_info);
       }
     }
   }

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