fix moves sometimes not undone when control is changed.

with the 'fix chat not working during delay/animation' it could happen
that play_slice_catch would process a incoming controller change in
which case that while loop would end without the code inside that 'if
(player_type_changed_)' being executed, which woudl lead to oos errors
since that client woudl have made moves that other players don't have.
This commit is contained in:
gfgtdf 2018-03-25 01:17:08 +01:00
parent 219f977b27
commit 1e1a6fbe48

View file

@ -139,6 +139,8 @@ void playmp_controller::play_human_turn()
while(!should_return_to_play_side()) {
try {
process_network_data();
check_objectives();
play_slice_catch();
if (player_type_changed_)
{
// Clean undo stack if turn has to be restarted (losing control)
@ -160,8 +162,6 @@ void playmp_controller::play_human_turn()
undo_stack().undo();
}
check_objectives();
play_slice_catch();
if(timer)
{
bool time_left = timer->update();