[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src gamestatus.hpp multiplayer_connect....
From: |
Philippe Plantier |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src gamestatus.hpp multiplayer_connect.... |
Date: |
Sun, 03 Oct 2004 14:07:14 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <address@hidden> 04/10/03 18:00:15
Modified files:
src : gamestatus.hpp multiplayer_connect.cpp
playlevel.cpp
Log message:
Fixed a bug where loading multiplayer savegames lost era information.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/gamestatus.hpp.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.cpp.diff?tr1=1.74&tr2=1.75&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playlevel.cpp.diff?tr1=1.154&tr2=1.155&r1=text&r2=text
Patches:
Index: wesnoth/src/gamestatus.hpp
diff -u wesnoth/src/gamestatus.hpp:1.32 wesnoth/src/gamestatus.hpp:1.33
--- wesnoth/src/gamestatus.hpp:1.32 Sun Sep 19 02:27:23 2004
+++ wesnoth/src/gamestatus.hpp Sun Oct 3 18:00:15 2004
@@ -1,4 +1,4 @@
-/* $Id: gamestatus.hpp,v 1.32 2004/09/19 02:27:23 Sirp Exp $ */
+/* $Id: gamestatus.hpp,v 1.33 2004/10/03 18:00:15 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -117,12 +117,12 @@
// Information on a particular player of the game.
struct player_info
{
- player_info():gold(-1) {}
+ player_info():gold(-1) {}
- int gold; //amount of gold the player has saved
- std::vector<unit> available_units; //units the player may recall
+ int gold; //amount of gold the player has saved
+ std::vector<unit> available_units; //units the player may recall
- std::set<std::string> can_recruit; //units the player has the ability to
recruit
+ std::set<std::string> can_recruit; //units the player has the ability
to recruit
};
//object which holds all the data needed to start a scenario.
@@ -148,14 +148,14 @@
// Return the Nth player, or NULL if no such player exists
player_info* get_player(const std::string& id) {
std::cerr << "get_player('" << id << "')\n";
- std::map<std::string, player_info>::iterator found=players.find(id);
+ std::map<std::string, player_info>::iterator
found=players.find(id);
- if(found==players.end()) {
- std::cerr << "WARNING: player " << id << " does not exist." <<
std::endl;
- return NULL;
- } else {
- return &found->second;
- }
+ if(found==players.end()) {
+ std::cerr << "WARNING: player " << id << " does not
exist." << std::endl;
+ return NULL;
+ } else {
+ return &found->second;
+ }
}
config variables; //variables that have been set
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.74
wesnoth/src/multiplayer_connect.cpp:1.75
--- wesnoth/src/multiplayer_connect.cpp:1.74 Mon Sep 27 00:24:41 2004
+++ wesnoth/src/multiplayer_connect.cpp Sun Oct 3 18:00:15 2004
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.74 2004/09/27 00:24:41 ydirson Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.75 2004/10/03 18:00:15 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -74,8 +74,6 @@
// Setup the game
config* level_ptr;
- era_ = era;
-
if(scenario_data.child("side") == NULL) {
//Load a saved game
save_ = true;
@@ -151,6 +149,13 @@
assert(level_ptr != NULL);
+ if(scenario_data["era"].empty()) {
+ era_ = era;
+ } else {
+ std::cerr << "Era set to " << scenario_data["era"] << "!";
+ era_ = scenario_data["era"];
+ }
+
//this will force connecting clients to be using the same version
number as us.
(*level_ptr)["version"] = game_config::version;
@@ -250,7 +255,7 @@
if(save_ == false) {
(*level_)["experience_modifier"] =
lexical_cast<std::string>(xpmodifier);
- (*level_)["era"] = era;
+ (*level_)["era"] = era_;
}
lists_init();
@@ -642,6 +647,7 @@
//Player race
combos_race_[n].enable(!save_);
+ combos_leader_[n].enable(!save_);
combos_team_[n].enable(!save_);
combos_color_[n].enable(!save_);
Index: wesnoth/src/playlevel.cpp
diff -u wesnoth/src/playlevel.cpp:1.154 wesnoth/src/playlevel.cpp:1.155
--- wesnoth/src/playlevel.cpp:1.154 Sat Oct 2 15:33:01 2004
+++ wesnoth/src/playlevel.cpp Sun Oct 3 18:00:15 2004
@@ -1,4 +1,4 @@
-/* $Id: playlevel.cpp,v 1.154 2004/10/02 15:33:01 Sirp Exp $ */
+/* $Id: playlevel.cpp,v 1.155 2004/10/03 18:00:15 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -271,7 +271,7 @@
//then add them
if(player && player->can_recruit.empty() == false) {
std::copy(player->can_recruit.begin(),player->can_recruit.end(),
-
std::inserter(teams.back().recruits(),teams.back().recruits().end()));
+
std::inserter(teams.back().recruits(),teams.back().recruits().end()));
}
if(player) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src gamestatus.hpp multiplayer_connect....,
Philippe Plantier <=