From 83f7adecc9ec6d769f10ee4df2e7f8c75a84ecb8 Mon Sep 17 00:00:00 2001 From: Cyp Date: Mon, 26 Mar 2012 13:16:27 +0200 Subject: [PATCH] Avoid mixing up droid orders during lag. Droid were sorted (in order to better compress net data) and queued, each game tick. During lag, multiple build orders could be queued, and executed in an unintended order due to being sorted. Queueing droid orders immediately after processing user input should fix this, while maintaining net data size efficiency. --- src/loop.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/loop.cpp b/src/loop.cpp index ac50af3a8..8101ba3f1 100644 --- a/src/loop.cpp +++ b/src/loop.cpp @@ -160,6 +160,8 @@ static GAMECODE renderLoop() if (!rotActive && getWidgetsStatus() && dragBox3D.status != DRAG_DRAGGING && wallDrag.status != DRAG_DRAGGING) { intRetVal = intRunWidgets(); + // Send droid orders, if any. (Should do between intRunWidgets() calls, to avoid droid orders getting mixed up, in the case of multiple orders given while the game freezes due to net lag.) + sendQueuedDroidInfo(); } //don't process the object lists if paused or about to quit to the front end