Author: alink
Date: Sun Apr 12 06:27:54 2009
New Revision: 34750
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34750&view=rev
Log:
Fix bug #13243 (missing faction name in MP wait UI) in 1.6
but only when host and client are 1.6.1 (1.6.0 does not send faction's name)
This introduce a new key 'faction_name'. Not sure if we must hide it for UMC,
so I add the hiding part in the next commit for the moment.
Modified:
branches/1.6/src/multiplayer_connect.cpp
branches/1.6/src/multiplayer_wait.cpp
Modified: branches/1.6/src/multiplayer_connect.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/multiplayer_connect.cpp?rev=34750&r1=34749&r2=34750&view=diff
==============================================================================
--- branches/1.6/src/multiplayer_connect.cpp (original)
+++ branches/1.6/src/multiplayer_connect.cpp Sun Apr 12 06:27:54 2009
@@ -626,6 +626,11 @@
res.append(*(parent_->era_sides_[faction_]));
}
res.append(cfg_);
+
+ // res["name"] will be overwritten below by a 1.6.0 bug
+ // so, record it here in another key
+ res["faction_name"] = res["name"];
+
if (cfg_.get_attribute("side").empty()
|| cfg_["side"] != lexical_cast<std::string>(index_ +
1))
{
Modified: branches/1.6/src/multiplayer_wait.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/multiplayer_wait.cpp?rev=34750&r1=34749&r2=34750&view=diff
==============================================================================
--- branches/1.6/src/multiplayer_wait.cpp (original)
+++ branches/1.6/src/multiplayer_wait.cpp Sun Apr 12 06:27:54 2009
@@ -450,10 +450,17 @@
continue;
}
- std::string description = sd["description"];
+ // 1.6.0 incorrectly uses sd["description"] which is empty
+ // std::string description = sd["description"];
+ std::string description = sd["name"];
const std::string faction_id = sd["id"];
- t_string side_name = sd["name"];
+ // 1.6.0 incorrectly uses sd["name"] which is the player's name
+ // t_string side_name = sd["name"];
+
+ // 1.6.0 host will not send this to us, so the column will be
empty
+ t_string side_name = sd["faction_name"];
+
std::string leader_type = sd["type"];
std::string gender_id = sd["gender"];
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits