<URL: http://bugs.freeciv.org/Ticket/Display.html?id=34095 >
On 1/19/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote: > > Some sanity checking for nations and players. For trunk only. One more assert added - 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 19:16:58.000000000 +0200 @@ -232,9 +232,11 @@ { if (pplayer->nation != pnation) { if (pplayer->nation) { + assert(pplayer->nation->player == pplayer); 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 19:16:35.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