CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <[EMAIL PROTECTED]> 05/07/23 17:18:35

Modified files:
        src/server     : game.cpp 

Log message:
        fixed bug where re-joining a game you've left as an observer with the 
same name causes out of sync

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/server/game.cpp.diff?tr1=1.41&tr2=1.42&r1=text&r2=text

Patches:
Index: wesnoth/src/server/game.cpp
diff -u wesnoth/src/server/game.cpp:1.41 wesnoth/src/server/game.cpp:1.42
--- wesnoth/src/server/game.cpp:1.41    Thu Jul 21 20:19:15 2005
+++ wesnoth/src/server/game.cpp Sat Jul 23 17:18:35 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.41 2005/07/21 20:19:15 isaaccp Exp $ */
+/* $Id: game.cpp,v 1.42 2005/07/23 17:18:35 Sirp Exp $ */
 /*
    Copyright (C) 2003-5 by David White <[EMAIL PROTECTED]>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -108,7 +108,14 @@
 
 void game::start_game()
 {
-       started_ = true;
+       started_ = true;
+
+       //set all side controllers to 'human' so that observers will understand 
that they can't
+       //take control of any sides if they happen to have the same name as one 
of the descriptions
+       config::child_itors& sides = level_.child_range("side");
+       for(; sides.first != sides.second; ++sides.first) {
+               (**sides.first)["controller"] = "human";
+       }
 
        describe_slots();
        if(description()) {


Reply via email to