Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13230) generate players with leader names
Home

[Freeciv-Dev] (PR#13230) generate players with leader names

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13230) generate players with leader names
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 7 Jun 2005 12:22:36 -0700
Reply-to: bugs@xxxxxxxxxxx

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

When assigning nations to players, this patch assigns leaders too.
Currently the leader name is taken to be the same as the pregame player
name, which is (for humans) the same as the username or (for AIs) garbage.

-jason

Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.267
diff -u -r1.267 srv_main.c
--- server/srv_main.c   4 Jun 2005 18:11:25 -0000       1.267
+++ server/srv_main.c   7 Jun 2005 19:21:31 -0000
@@ -1440,6 +1440,7 @@
     ai_data_analyze_rulesets(pplayer);
     
     if (pplayer->nation != NO_NATION_SELECTED) {
+      announce_player(pplayer);
       continue;
     }
 
@@ -1456,6 +1457,7 @@
       }
     }
     if (pplayer->nation != NO_NATION_SELECTED) {
+      announce_player(pplayer);
       continue;
     }
 
@@ -1466,9 +1468,13 @@
     pplayer->nation = nation;
     pplayer->city_style = get_nation_city_style(nation);
 
-    pplayer->is_male = (myrand(2) == 1);
-    if (pplayer->is_connected) {
-      /* FIXME: need to generate a leader name. */
+    pick_random_player_name(nation, player_name);
+    sz_strlcpy(pplayer->name, player_name);
+
+    if (check_nation_leader_name(nation, player_name)) {
+      pplayer->is_male = get_nation_leader_sex(nation, player_name);
+    } else {
+      pplayer->is_male = (myrand(2) == 1);
     }
 
     announce_player(pplayer);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13230) generate players with leader names, Jason Short <=