send the game ended server message at the same times we log it

This commit is contained in:
Gunter Labes 2009-04-15 16:06:05 +00:00
parent 642e699c3d
commit 7e2d260c0a

View File

@ -983,12 +983,11 @@ bool game::remove_player(const network::connection player, const bool disconnect
<< (observer ? " as an observer" : "")
<< (disconnect ? " and disconnected" : "")
<< ". (socket: " << user->first << ")\n";
// No need to do anything more when the game gets destructed.
if (destruct) return true;
if (game_ended) {
if (started_) send_server_message_to_all((user->second.name() + " ended the game.").c_str(), player);
return true;
if (game_ended && started_ && !(observer && destruct)) {
send_server_message_to_all((user->second.name() + " ended the game.").c_str(), player);
}
if (game_ended || destruct) return game_ended;
// Don't mark_available() since the player got already removed from the
// games_and_users_list_.
if (!disconnect) user->second.mark_available();