Author: suokko
Date: Thu Apr 16 12:16:09 2009
New Revision: 34963
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34963&view=rev
Log:
Fixed control transfer after player leaves MP game (bug #13238)
Modified:
trunk/changelog
trunk/src/playturn.cpp
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=34963&r1=34962&r2=34963&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Thu Apr 16 12:16:09 2009
@@ -98,6 +98,7 @@
* Fixed handling of floating-point WML constants on localized Windows
(impacts "submerge" animations and AI settings)
* Improved random village naming
+ * Fixed control transfer after player leaves MP game (bug #13238)
* Fixed a bug with auto-stored WML variables not being restored correctly
Version 1.6a:
Modified: trunk/src/playturn.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playturn.cpp?rev=34963&r1=34962&r2=34963&view=diff
==============================================================================
--- trunk/src/playturn.cpp (original)
+++ trunk/src/playturn.cpp Thu Apr 16 12:16:09 2009
@@ -271,12 +271,20 @@
throw end_level_exception(QUIT);
default:
if (action > 2) {
+
+ {
+ // Server thinks this side is
ours now so in case of error transfering side we have to make local state to
same as what server thinks it is.
+ teams_[side_index].make_human();
+
teams_[side_index].set_current_player("human"+side_str);
+ if(have_leader)
leader->second.rename("human"+side_str);
+ }
+
const size_t index =
static_cast<size_t>(action - 3);
if (index < observers.size()) {
change_side_controller(side_str, observers[index], false /*not our own side*/);
} else if (index < options.size() - 1) {
size_t i = index -
observers.size();
-
change_side_controller(side_str, allies[i]->save_id(), false /*not our own
side*/);
+
change_side_controller(side_str, allies[i]->current_player(), false /*not our
own side*/);
} else {
teams_[side_index].make_human_ai();
teams_[side_index].set_current_player("ai"+side_str);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits