fix possible oos when giving side to an oberver when a player left

fixes #3685
This commit is contained in:
gfgtdf 2018-11-03 19:09:43 +01:00
parent 469c8a3c8e
commit d67276b25b

View file

@ -438,6 +438,13 @@ void play_controller::maybe_do_init_side()
return;
}
if (current_team().is_idle()) {
// In this case it can happen that we just gave control of this side to another player so doing init_side
// could lead to errors since we no longer own this side from the servers perspective.
// (see playturn.cpp)
return;
}
resources::recorder->init_side();
do_init_side();
}