wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp
Date: Sun, 19 Sep 2004 14:45:50 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      04/09/19 18:39:21

Modified files:
        src            : multiplayer_connect.cpp 

Log message:
        Factions chosen at random now also have their leader type chosen at 
random.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.cpp.diff?tr1=1.67&tr2=1.68&r1=text&r2=text

Patches:
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.67 
wesnoth/src/multiplayer_connect.cpp:1.68
--- wesnoth/src/multiplayer_connect.cpp:1.67    Sat Sep 18 22:51:17 2004
+++ wesnoth/src/multiplayer_connect.cpp Sun Sep 19 18:39:20 2004
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.67 2004/09/18 22:51:17 gruikya Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.68 2004/09/19 18:39:20 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -730,7 +730,13 @@
                                const int choice = rand()%real_sides.size();
 
                                (**side)["name"] = 
(*real_sides[choice])["name"];
-                               (**side)["type"] = 
(*real_sides[choice])["type"];
+
+                               // Choose a random leader type.  
+                               std::vector<std::string> types = 
+                                       
config::split((*real_sides[choice])["leader"]);
+                               const int lchoice = rand() % types.size();
+
+                               (**side)["type"] = types[lchoice];
                                (**side)["recruit"] = 
(*real_sides[choice])["recruit"];
                                (**side)["music"] = 
(*real_sides[choice])["music"];
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]