Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2002:
[Freeciv-Dev] Re: cma assert at end of game (PR#2071)
Home

[Freeciv-Dev] Re: cma assert at end of game (PR#2071)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: cma assert at end of game (PR#2071)
From: Davide Pagnin <nightmare@xxxxxxxxxx>
Date: Tue, 8 Oct 2002 08:21:14 -0700 (PDT)

        Hi all!
Content-Type: multipart/mixed; boundary="=-eEQouzfW8exl4Lm/21P7"


--=-eEQouzfW8exl4Lm/21P7
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

        Hi all!

It has been somewhat agreed that a kludge *IS* the only possible fix for
this problem, at the moment...

(A proper fix will wait that the client is fully game_is_over aware)

Raimar has proposed this, and I've modified it so that it compiles
without warnings and that is complies actual CodingStyle (I hope).

In any case, I've tested this patch against this savegame:

http://www.enter.de/~c.knoke/bugs/endgame-assert-2.sav.gz

And, the client with the patch, doesn't issue any assert.

If there are no objection, I'll commit it soon.

        Ciao, Davide

--=-eEQouzfW8exl4Lm/21P7
Content-Disposition: attachment; filename=cmakludge2.diff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; name=cmakludge2.diff; charset=ISO-8859-1

diff -urN -Xfreeciv/diff_ignore freeciv/client/civclient.c freeciv-msg/clie=
nt/civclient.c
--- freeciv/client/civclient.c  Wed Oct  2 11:45:41 2002
+++ freeciv-msg/client/civclient.c      Tue Oct  8 16:57:18 2002
@@ -68,6 +68,7 @@
 #include "attribute.h"
 #include "agents.h"
 #include "audio.h"
+#include "cma_core.h"
=20
 #include "civclient.h"
=20
@@ -620,6 +621,17 @@
    * the kludge below.
    */
   if (newstate =3D=3D CLIENT_GAME_OVER_STATE) {
+    /*
+     * Extra kludge for end-game handling of the CMA.
+     */
+
+    city_list_iterate(game.player_ptr->cities, pcity) {
+      if (cma_is_city_under_agent(pcity, NULL)) {
+       cma_release_city(pcity);
+      }
+    }
+    city_list_iterate_end;
+
     newstate =3D CLIENT_GAME_RUNNING_STATE;
   }
=20

--=-eEQouzfW8exl4Lm/21P7--




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: cma assert at end of game (PR#2071), Davide Pagnin <=