Fix crash when setting persistence var in CClient struct

This commit is contained in:
Amos
2021-12-27 02:06:03 +01:00
parent c7987f8f6b
commit 77c2be57ec
3 changed files with 5 additions and 5 deletions

View File

@@ -15,9 +15,8 @@
//-----------------------------------------------------------------------------
bool HIVEngineServer_PersistenceAvailable(void* entidx, int clientidx)
{
CClient* pClient = g_pClient->GetClientInstance(clientidx); // Get client instance.
std::uintptr_t targetInstance = (std::uintptr_t)pClient;
*(char*)(targetInstance + g_dwPersistenceVar) = (char)0x5; // Set the client instance to 'ready'.
CClient* pClient = g_pClient->GetClientInstance(clientidx); // Get client instance.
*(char*)((std::uintptr_t)pClient + g_dwPersistenceVar) = (char)0x5; // Set the client instance to 'ready'.
if (!g_bIsPersistenceVarSet[clientidx] && sv_showconnecting->m_pParent->m_iValue > 0)
{