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

 Attached patch checks if two players have same nation and prints
message if they do. I mean to commit this to both trunk and S2_1 to
hunt down #17436.


 - ML

diff -Nurd -X.diff_ignore freeciv/server/srv_main.c freeciv/server/srv_main.c
--- freeciv/server/srv_main.c	2007-01-13 08:20:23.000000000 +0200
+++ freeciv/server/srv_main.c	2007-01-17 22:42:54.000000000 +0200
@@ -1510,7 +1510,7 @@
 }
 
 /**************************************************************************
-generate_ai_players() - Selects a nation for players created with
+generate_players() - Selects a nation for players created with
    server's "create <PlayerName>" command.  If <PlayerName> matches
    one of the leader names for some nation, we choose that nation.
    (I.e. if we issue "create Shaka" then we will make that AI player's
@@ -1887,7 +1887,23 @@
 #endif
 
   if (game.info.is_new_game) {
+    bool bug_reported = FALSE;
+
     generate_players();
+
+    players_iterate(pplayer) {
+      players_iterate(pplayer2) {
+        if (pplayer != pplayer2
+            && pplayer->nation == pplayer2->nation
+            && !bug_reported) {
+          freelog(LOG_ERROR,
+                  _("Two players with same nation! Please report this bug "
+                    "to " BUG_EMAIL_ADDRESS ". gameseed=%d"), game.seed);
+          bug_reported = TRUE;
+        }
+      } players_iterate_end;
+    } players_iterate_end;
+
     final_ruleset_adjustments();
   }
    
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to