Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#10181) Loading old save gives failed assert
Home

[Freeciv-Dev] (PR#10181) Loading old save gives failed assert

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: marko.lindqvist@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10181) Loading old save gives failed assert
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Tue, 21 Sep 2004 09:13:48 -0700
Reply-to: rt@xxxxxxxxxxx

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

> [marko.lindqvist@xxxxxxxxxxx - Sat Sep 18 21:49:44 2004]:
> 
> 
> Loading save from #8838:
> 
> 0: Boadicea's government is anarchy but does not finish
> assertion "pplayer->government != game.government_when_anarchy" failed
> 
> 
> 
> [player4]
> name="Boadicea"
> username="Unassigned"
> nation="Barbarian"
> race=61
> government=0
> ...
> revolution=0
> 
> 
>   Is this save from broken version or is our current savegame 
> compatibility code broken?
> 
> 
>   - Caz
> 
Patch attached
--
mateusz
Index: savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.190
diff -u -r1.190 savegame.c
--- savegame.c  21 Sep 2004 05:00:54 -0000      1.190
+++ savegame.c  21 Sep 2004 16:13:00 -0000
@@ -1656,7 +1656,12 @@
                                                plrno);
 
     if (revolution == 0) {
-      revolution = -1;
+      if (plr->government != game.government_when_anarchy) {
+        revolution = -1;
+      } else {
+        /* some old savegames may be buggy */
+        revolution = game.turn + 1;
+      }
     } else {
       revolution = game.turn + revolution;
     }

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