Skip to content

Commit

Permalink
Avoid mixing up droid orders during lag.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Cyp committed Mar 26, 2012
1 parent 556bbc0 commit 83f7ade
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/loop.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 83f7ade

Please sign in to comment.