Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] Re: (PR#13745) savegame crash
Home

[Freeciv-Dev] Re: (PR#13745) savegame crash

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#13745) savegame crash
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 23 Aug 2005 01:03:44 -0700
Reply-to: bugs@xxxxxxxxxxx

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

On Tue, 23 Aug 2005, Per I. Mathisen wrote:
> Forwarding from pubserver crash reports. Got several of these. No idea
> why. - Per

The problem seems to be that game.default_government is G_MAGIC, an
illegal government, when players are initialized in common/player.c, and
trying to save this results in an error. This could happen when creating
new players through barbarian uprising or civil war.

The attached patch should fix it. Committed immediately.

  - Per

Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.330.2.33
diff -u -r1.330.2.33 plrhand.c
--- server/plrhand.c    22 Aug 2005 20:58:52 -0000      1.330.2.33
+++ server/plrhand.c    23 Aug 2005 08:00:16 -0000
@@ -1975,6 +1975,7 @@
   sz_strlcpy(cplayer->username, ANON_USER_NAME);
   cplayer->is_connected = FALSE;
   cplayer->government = game.default_government;
+  cplayer->target_government = game.default_government;
   assert(cplayer->revolution_finishes < 0);
   cplayer->capital = TRUE;
 
Index: server/barbarian.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/barbarian.c,v
retrieving revision 1.79.2.3
diff -u -r1.79.2.3 barbarian.c
--- server/barbarian.c  22 Aug 2005 20:58:53 -0000      1.79.2.3
+++ server/barbarian.c  23 Aug 2005 08:00:17 -0000
@@ -126,6 +126,7 @@
   sz_strlcpy(barbarians->username, ANON_USER_NAME);
   barbarians->is_connected = FALSE;
   barbarians->government = game.default_government;
+  barbarians->target_government = game.default_government;
   assert(barbarians->revolution_finishes < 0);
   barbarians->capital = FALSE;
   barbarians->economic.gold = 100;

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