fixed bugs with replacing one player with another...
...and with observers being allowed into games that have observers disallowed
This commit is contained in:
parent
69832b1a3b
commit
a7ce41729e
2 changed files with 6 additions and 1 deletions
|
@ -2669,7 +2669,7 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
|
|||
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();
|
||||
}
|
||||
|
|
|
@ -254,6 +254,7 @@ bool game::describe_slots()
|
|||
|
||||
if(buf != (*description())["slots"]) {
|
||||
description()->values["slots"] = buf;
|
||||
description()->values["observer"] = level_["observer"];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -334,6 +335,10 @@ void game::add_player(network::connection player)
|
|||
{
|
||||
//if the game has already started, we add the player as an observer
|
||||
if(started_) {
|
||||
if(!allow_observers_) {
|
||||
return;
|
||||
}
|
||||
|
||||
const player_map::const_iterator info = player_info_->find(player);
|
||||
if(info != player_info_->end()) {
|
||||
config observer_join;
|
||||
|
|
Loading…
Add table
Reference in a new issue