Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] (PR#2929) pre-game assert in tech code
Home

[Freeciv-Dev] (PR#2929) pre-game assert in tech code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2929) pre-game assert in tech code
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Tue, 28 Jan 2003 12:23:53 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Try using aitoggle on a human player before the game starts.

 > aitoggle jdorje
jdorje is now under AI control.
Player 'jdorje' now has AI skill level 'easy'.
civserver: plrhand.c:1233: package_player_info: Assertion 
`(tech_exists(plr->research.researching) && plr->research.researching != 
0) || is_future_tech(plr->research.researching)' failed.

This is because of an overzealous assertion Raimar and I added.  The AI 
is researching A_NONE, which during a game is (supposed to be) 
impossible.  But of course before a game starts this is how it should be.

The easy way is just to change the assert.

jason

Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.257
diff -u -r1.257 plrhand.c
--- server/plrhand.c    2003/01/13 23:27:12     1.257
+++ server/plrhand.c    2003/01/28 20:22:09
@@ -1228,9 +1228,10 @@
    * This may be an odd time to check these values but we can be sure
    * to have a consistent state here.
    */
-  assert((tech_exists(plr->research.researching)
-         && plr->research.researching != A_NONE)
-        || is_future_tech(plr->research.researching));
+  assert(server_state != RUN_GAME_STATE
+        || ((tech_exists(plr->research.researching)
+             && plr->research.researching != A_NONE)
+            || is_future_tech(plr->research.researching)));
   assert((tech_exists(plr->ai.tech_goal) && plr->ai.tech_goal != A_NONE)
         || plr->ai.tech_goal == A_UNSET);
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2929) pre-game assert in tech code, Jason Short via RT <=