Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] (PR#13740) civil war starts invalid revolution
Home

[Freeciv-Dev] (PR#13740) civil war starts invalid revolution

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13740) civil war starts invalid revolution
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Aug 2005 11:44:25 -0700
Reply-to: bugs@xxxxxxxxxxx

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

This is just like PR#13723.  With the crash.rc from that ticket (and the 
barbarian crash fixed) I get...

Game saved as civgame+1650.sav.gz
 >
Player 'James' now has AI skill level 'easy'.
 > Segmentation fault (core dumped)

#0  get_government_name (gov=0x0) at government.c:131
#1  0x0807c525 in finish_revolution (pplayer=0x826e4ac) at plrhand.c:258
#2  0x0807cb0b in update_revolution (pplayer=0x826e4ac) at plrhand.c:412
#3  0x0804fba4 in begin_phase (is_new_phase=true) at srv_main.c:561
#4  0x080519da in main_loop () at srv_main.c:1588
#5  0x080521ff in srv_loop () at srv_main.c:1898
#6  0x08051d0d in srv_main () at srv_main.c:1718
#7  0x0804ad14 in main (argc=3, argv=0xbffe2114) at civserver.c:242

The attached patches fix this (just like 13723).

-jason

Index: server/barbarian.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/barbarian.c,v
retrieving revision 1.99
diff -p -u -r1.99 barbarian.c
--- server/barbarian.c  18 Aug 2005 06:44:28 -0000      1.99
+++ server/barbarian.c  22 Aug 2005 18:43:42 -0000
@@ -153,8 +153,8 @@ static struct player *create_barbarian_p
 
   sz_strlcpy(barbarians->username, ANON_USER_NAME);
   barbarians->is_connected = FALSE;
-  barbarians->government = game.government_when_anarchy;
-  barbarians->revolution_finishes = 1;
+  barbarians->government = nation->init_government;
+  assert(barbarians->revolution_finishes < 0);
   barbarians->capital = FALSE;
   barbarians->economic.gold = 100;
 
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.410
diff -p -u -r1.410 plrhand.c
--- server/plrhand.c    18 Aug 2005 18:30:08 -0000      1.410
+++ server/plrhand.c    22 Aug 2005 18:43:42 -0000
@@ -1522,8 +1522,8 @@ static struct player *split_player(struc
 
   sz_strlcpy(cplayer->username, ANON_USER_NAME);
   cplayer->is_connected = FALSE;
-  cplayer->government = game.government_when_anarchy;  
-  cplayer->revolution_finishes = game.info.turn + 1;
+  cplayer->government = cplayer->nation->init_government;
+  assert(cplayer->revolution_finishes < 0);
   cplayer->capital = TRUE;
 
   /* cplayer is not yet part of players_iterate which goes only
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.330.2.32
diff -p -u -r1.330.2.32 plrhand.c
--- server/plrhand.c    22 Aug 2005 08:04:56 -0000      1.330.2.32
+++ server/plrhand.c    22 Aug 2005 18:43:57 -0000
@@ -1974,8 +1974,8 @@ static struct player *split_player(struc
 
   sz_strlcpy(cplayer->username, ANON_USER_NAME);
   cplayer->is_connected = FALSE;
-  cplayer->government = game.government_when_anarchy;  
-  cplayer->revolution_finishes = game.turn + 1;
+  cplayer->government = game.default_government;
+  assert(cplayer->revolution_finishes < 0);
   cplayer->capital = TRUE;
 
   /* cplayer is not yet part of players_iterate which goes only

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13740) civil war starts invalid revolution, Jason Short <=