mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-03 22:41:37 +00:00
send the game ended server message at the same times we log it
This commit is contained in:
parent
642e699c3d
commit
7e2d260c0a
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user