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

 This patch reinitializes player->nation for all players when nations
are reinitialized.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/packhand.c freeciv/client/packhand.c
--- freeciv/client/packhand.c	2007-03-12 16:23:02.000000000 +0200
+++ freeciv/client/packhand.c	2007-03-12 22:32:11.000000000 +0200
@@ -2123,6 +2123,8 @@
 **************************************************************************/
 void handle_ruleset_control(struct packet_ruleset_control *packet)
 {
+  int i;
+
   ruleset_data_free();
 
   ruleset_cache_init();
@@ -2131,6 +2133,12 @@
   governments_alloc(packet->government_count);
   nations_alloc(packet->nation_count);
   city_styles_alloc(packet->styles_count);
+
+  /* We are in inconsistent state. Players point to nations,
+   * which do not point to players. Fix */
+  for (i = 0; i < MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS; i++) {
+    game.players[i].nation = NULL;
+  }
 }
 
 /**************************************************************************
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to