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:
parent
33f9bb9b56
commit
8083c3d475
2 changed files with 2 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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_);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue