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: Jon Daniel
Subject: [Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp
Date: Sat, 14 May 2005 06:59:02 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Jon Daniel <address@hidden>     05/05/14 10:59:02

Modified files:
        src            : multiplayer_connect.cpp 

Log message:
        Fixed bug #12954: causing a segfault when loading a saved multiplayer 
game and network slots get reset.

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

Patches:
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.143 
wesnoth/src/multiplayer_connect.cpp:1.144
--- wesnoth/src/multiplayer_connect.cpp:1.143   Sat May  7 21:53:42 2005
+++ wesnoth/src/multiplayer_connect.cpp Sat May 14 10:58:54 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.143 2005/05/07 21:53:42 ettin Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.144 2005/05/14 10:58:54 j_daniel Exp $ */
 /*
    Copyright (C) 
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -408,7 +408,7 @@
        id_ = data["name"];
        controller_ = CNTR_NETWORK;
 
-       if (enabled_) {
+       if (enabled_ && !parent_->era_sides_.empty()) {
                faction_ = lexical_cast_default<int>(data["faction"], 0);
                if (faction_ > int(parent_->era_sides_.size()))
                        faction_ = 0;
@@ -422,10 +422,13 @@
 void connect::side::reset(mp::controller controller)
 {
        id_ = "";
-       faction_ = 0;
        controller_ = controller;
 
-       llm_.update_leader_list(0);
+       if(enabled_ && !parent_->era_sides_.empty()) {
+               faction_ = 0;
+               llm_.update_leader_list(0);
+       }
+
        update_ui();
 }
 
@@ -907,7 +910,6 @@
                level_ = params_.scenario_data;
                level_["turns"] = 
lexical_cast_default<std::string>(params_.num_turns, "20");
 
-               // Gets the era from the era of the savegame
                const std::string& era = params_.era;
 
                // Initialize the list of sides available for the current era.
@@ -920,14 +922,12 @@
                era_sides_ = era_cfg->get_children("multiplayer_side");
                level_["scenario"] = params_.name;
                level_.add_child("era", *era_cfg);
+               level_["experience_modifier"] = 
lexical_cast<std::string>(params_.xp_modifier);
        }
 
        //this will force connecting clients to be using the same version 
number as us.
        level_["version"] = game_config::version;
 
-       if(!params_.saved_game) 
-               level_["experience_modifier"] = 
lexical_cast<std::string>(params_.xp_modifier);
-
        level_["observers"] = params_.allow_observers ? "yes" : "no";
 
        if(level_["objectives"].empty()) {




reply via email to

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