Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] (PR#5114) advdiplomacy.c:904: ai_diplomacy_actions: Assert
Home

[Freeciv-Dev] (PR#5114) advdiplomacy.c:904: ai_diplomacy_actions: Assert

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: maage@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#5114) advdiplomacy.c:904: ai_diplomacy_actions: Assertion `!pplayers_allied(target, pplayer)' failed.
From: "Guest" <rt-guest@xxxxxxxxxxxxxx>
Date: Sat, 16 Aug 2003 05:26:52 -0700
Reply-to: rt@xxxxxxxxxxxxxx

CVS 2003-08-16 GTK 2

Start autogame with:
LC_ALL=C civserver --read ../tstrc --gamelog civgame.log --log civ.log

This assert is repeatable when starting fresh game. But I can't repeat
it by loading saved game.

Game saved as civgame-0075.sav.gz
> civserver: ../../../freeciv-cvs/ai/advdiplomacy.c:904:
ai_diplomacy_actions: Assertion `!pplayers_allied(target, pplayer)' failed.

(gdb) where
#0  0x400f66a1 in kill () from /lib/i686/libc.so.6
#1  0x400f6435 in raise () from /lib/i686/libc.so.6
#2  0x400f797b in abort () from /lib/i686/libc.so.6
#3  0x400ef985 in __assert_fail () from /lib/i686/libc.so.6
#4  0x080beed8 in ai_diplomacy_actions (pplayer=0x817d78c)
    at ../../../freeciv-cvs/ai/advdiplomacy.c:904
#5  0x0804daf9 in begin_turn () at
../../../freeciv-cvs/server/srv_main.c:478
#6  0x0804f119 in main_loop () at
../../../freeciv-cvs/server/srv_main.c:1434
#7  0x0804f581 in srv_main () at ../../../freeciv-cvs/server/srv_main.c:1591
#8  0x0804a224 in main (argc=7, argv=0xbffff974)
    at ../../../freeciv-cvs/server/civserver.c:154
#9  0x400e3a07 in __libc_start_main () from /lib/i686/libc.so.6

(gdb) print *pplayer
$1 = {player_no = 6, name = "Borna", '\0' <repeats 26 times>, 
...

(gdb) print *target
$3 = {player_no = 3, name = "Ze'ev Zabotinsky", '\0' <repeats 15 times>, 
...

I have following patches in able to run game so far (game kept bumping
at assert get_defender) and to compile server out of place:
Index: ai/aiunit.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aiunit.c,v
retrieving revision 1.282
diff -u -u -r1.282 aiunit.c
--- ai/aiunit.c 2003/08/08 22:11:41     1.282
+++ ai/aiunit.c 2003/08/16 12:09:34
@@ -2230,7 +2230,8 @@
         continue;
       }
 
-      if (!can_unit_attack_unit_at_tile(punit, aunit, aunit->x, aunit->y)
+      if (!can_player_attack_tile(pplayer, aunit->x, aunit->y) 
+          || !can_unit_attack_unit_at_tile(punit, aunit, aunit->x,
aunit->y) 
           || !(aunit == get_defender(punit, aunit->x, aunit->y))) {
         /* We cannot attack it, or it is not the main defender. */
         continue;


Index: common/combat.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/combat.c,v
retrieving revision 1.31
diff -u -u -r1.31 combat.c
--- common/combat.c     2003/06/04 20:05:40     1.31
+++ common/combat.c     2003/08/16 12:09:34
@@ -583,7 +583,6 @@
   unit_list_iterate(map_get_tile(x, y)->units, defender) {
     if (pplayers_allied(att_owner, unit_owner(defender)))
       continue;
-    count++;
     if (unit_can_defend_here(defender)) {
       bool change = FALSE;
       int build_cost = unit_type(defender)->build_cost;
@@ -592,6 +591,7 @@
       /* This will make units roughly evenly good defenders look alike. */
       int unit_def = (int) (100000 * (1 - unit_win_chance(attacker,
defender)));
       assert(unit_def >= 0);
+      count++;
 
       if (unit_def > bestvalue) {
        change = TRUE;


Index: common/game.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.h,v
retrieving revision 1.124
diff -u -u -r1.124 game.h
--- common/game.h       2003/08/10 14:44:14     1.124
+++ common/game.h       2003/08/16 12:09:34
@@ -395,7 +395,7 @@
 #ifndef NDEBUG
 #define GAME_MIN_TIMEOUT             -1
 #else
-#define GAME_MIN_TIMEOUT             0
+#define GAME_MIN_TIMEOUT             -1
 #endif
 #define GAME_MAX_TIMEOUT             8639999
 


Index: data/nation/Makefile.am.sh
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/Makefile.am.sh,v
retrieving revision 1.3
diff -u -u -r1.3 Makefile.am.sh
--- data/nation/Makefile.am.sh  2003/02/14 09:30:29     1.3
+++ data/nation/Makefile.am.sh  2003/08/16 12:09:35
@@ -15,7 +15,6 @@
 
 EXTRA_DIST = \$(pkgdata_DATA) Makefile.am.sh
 
-Makefile.am: Makefile.am.sh \$(shell echo *.ruleset)
-       sh Makefile.am.sh >Makefile.am
-
+\$(srcdir)/Makefile.am: \$(srcdir)/Makefile.am.sh \$(shell echo
\$(srcdir)/*.ruleset)
+       (cd \$(srcdir) && sh Makefile.am.sh > Makefile.am)
 EOF


-- 
//Markus

Attachment: tstrc
Description: tstrc


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