This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).
Revision | 8f2036dc0d8fd34dda286eaf00fb4cd1b8e3499e (tree) |
---|---|
Time | 2021-07-19 00:26:04 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Organize late movement commands from a player chronologically in case the server receives them in the wrong order.
@@ -5098,7 +5098,19 @@ | ||
5098 | 5098 | // [AK] We want to try filling this buffer only when the client is suffering from a ping |
5099 | 5099 | // spike, not when they're experiencing packet loss. |
5100 | 5100 | if ( cmd->getClientTic( ) <= ulMaxClientTic ) |
5101 | + { | |
5101 | 5102 | buffer = &g_aClients[g_lCurrentClient].LateMoveCMDs; |
5103 | + | |
5104 | + // [AK] Organize the late movement commands in case they arrived in the wrong order. | |
5105 | + for ( unsigned int i = 0; i < buffer->Size( ); i++ ) | |
5106 | + { | |
5107 | + if ( cmd->getClientTic( ) < ( *buffer )[i]->getClientTic( )) | |
5108 | + { | |
5109 | + buffer->Insert( i, cmd ); | |
5110 | + return false; | |
5111 | + } | |
5112 | + } | |
5113 | + } | |
5102 | 5114 | } |
5103 | 5115 | } |
5104 | 5116 |