[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp
From: |
Jon Daniel |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp |
Date: |
Sun, 11 Sep 2005 17:29:14 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Jon Daniel <address@hidden> 05/09/11 21:29:14
Modified files:
src : multiplayer_connect.cpp
Log message:
Use numeric team_names correspondening to the side number without use
map settings but map existing team_names to the side numbers.
This way players will be able to play maps which supply less teams than
there are sides ffa without use map settings.
If use map settings is enabled the already existing behaviour will be
used.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.cpp.diff?tr1=1.156&tr2=1.157&r1=text&r2=text
Patches:
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.156
wesnoth/src/multiplayer_connect.cpp:1.157
--- wesnoth/src/multiplayer_connect.cpp:1.156 Tue Sep 6 13:53:14 2005
+++ wesnoth/src/multiplayer_connect.cpp Sun Sep 11 21:29:14 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.156 2005/09/06 13:53:14 ott Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.157 2005/09/11 21:29:14 j_daniel Exp $ */
/*
Copyright (C)
Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -836,16 +836,39 @@
//Teams
config::child_iterator sd;
- for(sd = sides.first; sd != sides.second; ++sd) {
- const int side_num = sd - sides.first + 1;
- t_string& team_name = (**sd)["team_name"];
- if(team_name.empty()) {
- team_name = lexical_cast<std::string>(side_num);
- }
- std::vector<std::string>::const_iterator itor =
std::find(team_names_.begin(), team_names_.end(), team_name);
- if(itor == team_names_.end()) {
- team_names_.push_back(team_name);
- player_teams_.push_back(team_prefix_ + team_name.str());
+ if(params_.use_map_settings) {
+ for(sd = sides.first; sd != sides.second; ++sd) {
+ const int side_num = sd - sides.first + 1;
+ t_string& team_name = (**sd)["team_name"];
+
+ if(team_name.empty())
+ team_name = lexical_cast<std::string>(side_num);
+
+ std::vector<std::string>::const_iterator itor =
std::find(team_names_.begin(), team_names_.end(), team_name);
+ if(itor == team_names_.end()) {
+ team_names_.push_back(team_name);
+ player_teams_.push_back(team_prefix_ +
team_name.str());
+ }
+ }
+ } else {
+ std::vector<std::string> team_names;
+ for(sd = sides.first; sd != sides.second; ++sd) {
+ const std::string side_num =
lexical_cast<std::string>(sd - sides.first + 1);
+ t_string& team_name = (**sd)["team_name"];
+
+ if(team_name.empty())
+ team_name = side_num;
+
+ std::vector<std::string>::const_iterator itor =
std::find(team_names.begin(), team_names.end(), team_name);
+ if(itor == team_names.end()) {
+ team_names.push_back(team_name);
+ team_name = side_num;
+ } else {
+ team_name = lexical_cast<std::string>(itor -
team_names.begin() + 1);
+ }
+
+ team_names_.push_back(side_num);
+ player_teams_.push_back(team_prefix_ + side_num);
}
}
- [Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp,
Jon Daniel <=