[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src game.cpp
From: |
David White |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src game.cpp |
Date: |
Sat, 22 Jan 2005 09:22:26 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: David White <address@hidden> 05/01/22 14:22:25
Modified files:
src : game.cpp
Log message:
made --multiplayer option work by default
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.180&tr2=1.181&r1=text&r2=text
Patches:
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.180 wesnoth/src/game.cpp:1.181
--- wesnoth/src/game.cpp:1.180 Tue Jan 11 12:41:06 2005
+++ wesnoth/src/game.cpp Sat Jan 22 14:22:25 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.180 2005/01/11 12:41:06 Sirp Exp $ */
+/* $Id: game.cpp,v 1.181 2005/01/22 14:22:25 Sirp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -729,6 +729,13 @@
const config* side = type == side_types.end() ?
era_cfg->child("multiplayer_side") :
era_cfg->find_child("multiplayer_side","type",type->second);
+
+ if((*side)["random_faction"] == "yes") {
+ const config::child_list& eras =
era_cfg->get_children("multiplayer_side");
+ for(int i = 0; i != 100 && (*side)["random_faction"] ==
"yes"; ++i) {
+ side = eras[rand()%eras.size()];
+ }
+ }
if(side == NULL || (*side)["random_faction"] == "yes" ||
(*side)["type"] == "random") {
std::string side_name = (type == side_types.end() ?
"default" : type->second);
- [Wesnoth-cvs-commits] wesnoth/src game.cpp,
David White <=