From bb02e30a37b1b86bcf57cfed6e7f25b45c298e09 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 23 Nov 2010 23:59:24 +0000 Subject: (svn r21308) -Fix [FS#4262] (r20933-ish): crash upon desync --- src/network/network.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/network.cpp b/src/network/network.cpp index 050b644ba..812217cc1 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -927,12 +927,16 @@ void NetworkGameLoop() /* Make sure we are at the frame were the server is (quick-frames) */ if (_frame_counter_server > _frame_counter) { + /* Run a number of frames; when things go bad, get out. */ while (_frame_counter_server > _frame_counter) { - if (!ClientNetworkGameSocketHandler::GameLoop()) break; + if (!ClientNetworkGameSocketHandler::GameLoop()) return; } } else { /* Else, keep on going till _frame_counter_max */ - if (_frame_counter_max > _frame_counter) ClientNetworkGameSocketHandler::GameLoop(); + if (_frame_counter_max > _frame_counter) { + /* Run one frame; if things went bad, get out. */ + if (!ClientNetworkGameSocketHandler::GameLoop()) return; + } } } -- cgit v1.2.3-70-g09d2