@ -69,11 +69,11 @@ uint8_t sgbDeltaChunks;
std : : list < TMegaPkt > MegaPktList ;
Item ItemLimbo ;
/** @brief Last send player command for the local player. */
TCmdLocParam4 lastSend PlayerCmd ;
/** @brief Last sent player command for the local player. */
TCmdLocParam4 lastSent PlayerCmd ;
/**
* @ brief Throttles that a player command is only send once per game tick .
* @ brief Throttles that a player command is only sent once per game tick .
* This is a workaround for a desync that happens when a command is processed in different game ticks for different clients . See https : //github.com/diasurgical/devilutionX/issues/2681 for details.
* When a proper fix is implemented this workaround can be removed .
*/
@ -109,13 +109,13 @@ bool WasPlayerCmdAlreadyRequested(_cmd_id bCmd, Point position = {}, uint16_t wP
TCmdLocParam4 newSendParam = { bCmd , static_cast < uint8_t > ( position . x ) , static_cast < uint8_t > ( position . y ) , wParam1 , wParam2 , wParam3 , wParam4 } ;
if ( lastSend PlayerCmd . bCmd = = newSendParam . bCmd & & lastSend PlayerCmd . x = = newSendParam . x & & lastSend PlayerCmd . y = = newSendParam . y
& & lastSend PlayerCmd . wParam1 = = newSendParam . wParam1 & & lastSend PlayerCmd . wParam2 = = newSendParam . wParam2 & & lastSend PlayerCmd . wParam3 = = newSendParam . wParam3 & & lastSend PlayerCmd . wParam4 = = newSendParam . wParam4 ) {
if ( lastSent PlayerCmd . bCmd = = newSendParam . bCmd & & lastSent PlayerCmd . x = = newSendParam . x & & lastSent PlayerCmd . y = = newSendParam . y
& & lastSent PlayerCmd . wParam1 = = newSendParam . wParam1 & & lastSent PlayerCmd . wParam2 = = newSendParam . wParam2 & & lastSent PlayerCmd . wParam3 = = newSendParam . wParam3 & & lastSent PlayerCmd . wParam4 = = newSendParam . wParam4 ) {
// Command already send in this game tick => don't send again / throttle
return true ;
}
lastSend PlayerCmd = newSendParam ;
lastSent PlayerCmd = newSendParam ;
return false ;
}
@ -2015,7 +2015,7 @@ DWORD OnOpenCrypt(const TCmd *pCmd)
void ClearLastSendPlayerCmd ( )
{
lastSend PlayerCmd = { } ;
lastSent PlayerCmd = { } ;
}
void msg_send_drop_pkt ( int pnum , int reason )