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

 Some sanity checking for nations and players. For trunk only.


 - ML

diff -Nurd -X.diff_ignore freeciv/common/player.c freeciv/common/player.c
--- freeciv/common/player.c	2006-07-17 23:56:46.000000000 +0300
+++ freeciv/common/player.c	2007-01-19 18:47:14.000000000 +0200
@@ -235,6 +235,7 @@
       pplayer->nation->player = NULL;
     }
     if (pnation) {
+      assert(pnation->player == NULL);
       pnation->player = pplayer;
     }
     pplayer->nation = pnation;
diff -Nurd -X.diff_ignore freeciv/server/sanitycheck.c freeciv/server/sanitycheck.c
--- freeciv/server/sanitycheck.c	2006-07-17 23:56:22.000000000 +0300
+++ freeciv/server/sanitycheck.c	2007-01-19 18:50:43.000000000 +0200
@@ -466,6 +466,8 @@
       continue;
     }
 
+    SANITY_CHECK(!pplayer->nation || pplayer->nation->player == pplayer);
+
     city_list_iterate(pplayer->cities, pcity) {
       if (is_capital(pcity)) {
 	found_palace++;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to