This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).
Revision | 4bb3026890ef34e60a16feae33eee6e0b3f4d1b0 (tree) |
---|---|
Time | 2021-07-18 13:48:16 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Changed some of the skip correction code.
@@ -411,6 +411,15 @@ | ||
411 | 411 | const bool bMovement = client->MoveCMDs[0]->isMoveCmd( ); |
412 | 412 | client->MoveCMDs[0]->process( ulIdx ); |
413 | 413 | |
414 | + if ( bMovement ) | |
415 | + { | |
416 | + if ( client->LastMoveCMD != NULL ) | |
417 | + delete client->LastMoveCMD; | |
418 | + | |
419 | + // [AK] This becomes the last movement command we received from the client. | |
420 | + client->LastMoveCMD = new ClientMoveCommand( *static_cast<ClientMoveCommand *>( client->MoveCMDs[0] )); | |
421 | + } | |
422 | + | |
414 | 423 | delete client->MoveCMDs[0]; |
415 | 424 | client->MoveCMDs.Delete(0); |
416 | 425 |
@@ -5088,25 +5088,18 @@ | ||
5088 | 5088 | { |
5089 | 5089 | if (( sv_smoothplayers ) && ( cmd->isMoveCmd( ))) |
5090 | 5090 | { |
5091 | - ULONG ulNewClientTic = cmd->getClientTic( ); | |
5092 | - | |
5093 | 5091 | // [AK] It's possible this was a command that arrived late and we already extrapolated |
5094 | 5092 | // the player's movement at this tic. In this case, we'll store these commands into a |
5095 | 5093 | // separate buffer so we can backtrace the player's actual movement. |
5096 | - if ( g_aClients[g_lCurrentClient].LastMoveCMD != NULL ) | |
5094 | + if (( g_aClients[g_lCurrentClient].LastMoveCMD != NULL ) && ( g_aClients[g_lCurrentClient].ulExtrapolatedTics > 0 )) | |
5097 | 5095 | { |
5098 | 5096 | ULONG ulMaxClientTic = g_aClients[g_lCurrentClient].LastMoveCMD->getClientTic( ) + g_aClients[g_lCurrentClient].ulExtrapolatedTics; |
5099 | 5097 | |
5100 | 5098 | // [AK] We want to try filling this buffer only when the client is suffering from a ping |
5101 | 5099 | // spike, not when they're experiencing packet loss. |
5102 | - if (( ulNewClientTic < ulMaxClientTic ) || (( g_aClients[g_lCurrentClient].ulExtrapolatedTics > 1 ) && ( ulNewClientTic == ulMaxClientTic ))) | |
5100 | + if ( cmd->getClientTic( ) <= ulMaxClientTic ) | |
5103 | 5101 | buffer = &g_aClients[g_lCurrentClient].LateMoveCMDs; |
5104 | - | |
5105 | - delete g_aClients[g_lCurrentClient].LastMoveCMD; | |
5106 | 5102 | } |
5107 | - | |
5108 | - // [AK] This becomes the last movement command we received from the client. | |
5109 | - g_aClients[g_lCurrentClient].LastMoveCMD = new CommandType( *cmd ); | |
5110 | 5103 | } |
5111 | 5104 | |
5112 | 5105 | buffer->Push( cmd ); |