wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp
Date: Wed, 19 Jan 2005 17:02:23 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    05/01/19 22:02:23

Modified files:
        src            : multiplayer_connect.cpp 

Log message:
        Factor color code, and reinitialize to random upon deconnect (part of 
the patch in bug #11582).

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.cpp.diff?tr1=1.97&tr2=1.98&r1=text&r2=text

Patches:
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.97 
wesnoth/src/multiplayer_connect.cpp:1.98
--- wesnoth/src/multiplayer_connect.cpp:1.97    Tue Jan 18 12:25:21 2005
+++ wesnoth/src/multiplayer_connect.cpp Wed Jan 19 22:02:22 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.97 2005/01/18 12:25:21 isaaccp Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.98 2005/01/19 22:02:22 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -677,11 +677,6 @@
                        level_changed = true;
                }
 
-               if (combos_color_[n].changed()) {
-                       side["colour"] = 
lexical_cast_default<std::string>(combos_color_[n].selected()+1);
-               }
-
-                       
                if (!save_ && combos_race_[n].changed()) {
                        const string_map& values =  
possible_sides[combos_race_[n].selected()]->values;
                        side["random_faction"] = "";
@@ -693,6 +688,12 @@
 
                        
player_leaders_[n].update_leader_list(combos_race_[n].selected());
                }
+               
+               //Player colour
+               if (combos_color_[n].changed()) {
+                       side["colour"] = 
lexical_cast_default<std::string>(combos_color_[n].selected()+1);
+                       level_changed = true;
+               }
 
                //Player leader
                if (!save_ && combos_leader_[n].changed()) {
@@ -706,10 +707,6 @@
                        level_changed = true;
                }
 
-               if (combos_color_[n].changed()) {
-                       level_changed = true;
-               }
-
                if(!save_){
                        const int cur_playergold = sliders_gold_[n].value();
                        std::stringstream playergold;
@@ -921,6 +918,9 @@
                                i->first->values.erase("taken");
                                remove_player(i->first->values["description"]);
                                i->first->values["description"] = "";
+                               i->first->values["name"] = 
player_races_.front();
+                               i->first->values["random_faction"] = "yes";
+                               i->first->values["type"] = "";
                        }
                }
 
@@ -950,6 +950,9 @@
                                pos->first->values.erase("taken");
                                
remove_player(pos->first->values["description"]);
                                pos->first->values["description"] = "";
+                               pos->first->values["name"] = 
player_races_.front();
+                               pos->first->values["random_faction"] = "yes";
+                               pos->first->values["type"] = "";
                                network::send_data(*level_);
                        }
                        return;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]