fix chat during delay is start event blocks client #1857

the `replay_->at_end()` check was added in 81b6c3ab99 and is not needed anymore after 9ca6678479

This also removes the `gamestate().gamedata_.phase() != game_data::PLAY` check which was previously there to fix the case when a [change_controller] was received while waiting for a serversided random seed during a start event. But that's not needed anymore after 11daa5113a since now the client doesn't anymore call maybe_do_init_side whenever he reveives a [change_controller]
This commit is contained in:
gfgtdf 2017-07-23 23:34:34 +02:00 committed by GitHub
parent e85b429b0b
commit 75cc7e62f6

View file

@ -409,7 +409,20 @@ void play_controller::maybe_do_init_side()
// For all other sides it is recorded in replay and replay handler has to handle
// calling do_init_side() functions.
//
if (gamestate_->init_side_done() || !current_team().is_local() || gamestate().gamedata_.phase() != game_data::PLAY || is_replay() || !replay_->at_end()) {
if (gamestate_->init_side_done()) {
// We already executed do_init_side this can for example happe if we reload a game,
// but also if we changed control of a side during it's turn
return;
}
if (!current_team().is_local()) {
// We are in a mp game and execute do_init_side as soon as we receive [init_side] from the current player
// (see replay.cpp)
return;
}
if (is_replay()) {
// We are in a replay and execute do_init_side as soon as we reach the next [init_side] in the replay data
// (see replay.cpp)
return;
}