Stay in game if no side could be found

Having no side is the definition of an observer. No need to add new
client-server messages for this. This is not a new feature either.
This commit is contained in:
Gunter Labes 2018-02-13 22:17:40 +01:00
parent 33f9bb9b56
commit 8083c3d475
2 changed files with 2 additions and 11 deletions

View file

@ -125,8 +125,6 @@ bool mp_join_game::fetch_game_config()
}
has_scenario_and_controllers = true;
} else if(revc.has_child("became_observer")) {
observe_game_ = true;
}
}
@ -185,7 +183,8 @@ bool mp_join_game::fetch_game_config()
}
if(!side_choice) {
return false;
observe_game_ = true;
return true;
}
// If the client is allowed to choose their team, do that here instead of having it set by the server

View file

@ -1409,14 +1409,6 @@ bool game::add_player(const socket_ptr& player, bool observer)
player_connections_.find(user)->info().set_status((observer) ? player::OBSERVING : player::PLAYING);
DBG_GAME << debug_player_info();
// If a player was switched to an observer, notify them of the fact.
if(became_observer) {
simple_wml::document became_observer_notif;
became_observer_notif.root().add_child("became_observer");
send_to_player(player, became_observer_notif);
}
// Send the user the game data.
send_to_player(player, level_);