[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src playturn.cpp server/game.cpp
From: |
David White |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src playturn.cpp server/game.cpp |
Date: |
Sat, 29 Jan 2005 17:13:52 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: David White <address@hidden> 05/01/29 22:13:52
Modified files:
src : playturn.cpp
src/server : game.cpp
Log message:
fixed bugs with replacing one player with another and with observers
being allowed into games that have observers disallowed
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.326&tr2=1.327&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/server/game.cpp.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
Patches:
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.326 wesnoth/src/playturn.cpp:1.327
--- wesnoth/src/playturn.cpp:1.326 Sat Jan 29 00:04:54 2005
+++ wesnoth/src/playturn.cpp Sat Jan 29 22:13:52 2005
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.326 2005/01/29 00:04:54 Sirp Exp $ */
+/* $Id: playturn.cpp,v 1.327 2005/01/29 22:13:52 Sirp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -2669,7 +2669,7 @@
const size_t index =
static_cast<size_t>(action - 3);
if (index < observers.size()) {
teams_[side].make_network();
-
change_side_controller(cfg["side_drop"], observers[index]);
+
change_side_controller(cfg["side_drop"], observers[index], true /*is orphaned
side*/);
} else {
teams_[side].make_ai();
}
Index: wesnoth/src/server/game.cpp
diff -u wesnoth/src/server/game.cpp:1.23 wesnoth/src/server/game.cpp:1.24
--- wesnoth/src/server/game.cpp:1.23 Fri Dec 31 21:01:38 2004
+++ wesnoth/src/server/game.cpp Sat Jan 29 22:13:52 2005
@@ -253,7 +253,8 @@
sprintf(buf,"%d",val);
if(buf != (*description())["slots"]) {
- description()->values["slots"] = buf;
+ description()->values["slots"] = buf;
+ description()->values["observer"] = level_["observer"];
return true;
} else {
return false;
@@ -333,7 +334,11 @@
void game::add_player(network::connection player)
{
//if the game has already started, we add the player as an observer
- if(started_) {
+ if(started_) {
+ if(!allow_observers_) {
+ return;
+ }
+
const player_map::const_iterator info =
player_info_->find(player);
if(info != player_info_->end()) {
config observer_join;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src playturn.cpp server/game.cpp,
David White <=