Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#9863) govt sanity check asserts
Home

[Freeciv-Dev] Re: (PR#9863) govt sanity check asserts

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#9863) govt sanity check asserts
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 29 Aug 2004 12:36:56 -0700
Reply-to: rt@xxxxxxxxxxx

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

On Sun, 29 Aug 2004, Per I. Mathisen wrote:
> > civserver: sanitycheck.c:356: check_players: Assertion
> `pplayer->government != game.government_when_anarchy' failed.
> Aborted
>
> AI autogames give me this. Jason?

The problem is that barbarians do not have pplayer->revolution_finished
set. Fix attached will be committed at once.

  - Per

Index: server/barbarian.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/barbarian.c,v
retrieving revision 1.75
diff -u -r1.75 barbarian.c
--- server/barbarian.c  12 Jul 2004 20:26:42 -0000      1.75
+++ server/barbarian.c  29 Aug 2004 19:35:58 -0000
@@ -125,6 +125,7 @@
   sz_strlcpy(barbarians->username, ANON_USER_NAME);
   barbarians->is_connected = FALSE;
   barbarians->government = game.government_when_anarchy; 
+  barbarians->revolution_finishes = 1;
   barbarians->capital = FALSE;
   barbarians->economic.gold = 100;
 
Index: server/sanitycheck.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sanitycheck.c,v
retrieving revision 1.49
diff -u -r1.49 sanitycheck.c
--- server/sanitycheck.c        27 Aug 2004 17:36:53 -0000      1.49
+++ server/sanitycheck.c        29 Aug 2004 19:35:58 -0000
@@ -353,6 +353,10 @@
     } players_iterate_end;
 
     if (pplayer->revolution_finishes == -1) {
+      if (pplayer->government == game.government_when_anarchy) {
+        freelog(LOG_FATAL, "%s's government is anarchy but does not finish",
+                pplayer->name);
+      }
       assert(pplayer->government != game.government_when_anarchy);
     } else if (pplayer->revolution_finishes > game.turn) {
       assert(pplayer->government == game.government_when_anarchy);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#9863) govt sanity check asserts, Per I. Mathisen <=