r5sdk/r5dev/engine/server/vengineserver_impl.cpp
Kawe Mazidjatari 552f5f750c Fix crash in 'CClient::ActivatePlayer'
Set the persistence fields to 'ready' in 'CClient::ActivatePlayer', before executing the rest of the function. Previously, it was set in 'CVEngineServer::PersistenceAvailable', but this is too late. The function 'FairFight_Init' was actually 'CClient::ActivatePlayer', and thus it has been moved to the correct file, and the old file defining it previously has been removed.
2023-05-15 17:19:18 +02:00

32 lines
1.2 KiB
C++

//=============================================================================//
//
// Purpose: Interface the engine exposes to the game DLL
//
//=============================================================================//
#include "vengineserver_impl.h"
//-----------------------------------------------------------------------------
// Purpose: sets the persistence var in the CClient instance to 'ready'
//-----------------------------------------------------------------------------
bool CVEngineServer::PersistenceAvailable(void* entidx, int clientidx)
{
///////////////////////////////////////////////////////////////////////////
return IVEngineServer__PersistenceAvailable(entidx, clientidx);
}
void HVEngineServer::Attach() const
{
DetourAttach(&IVEngineServer__PersistenceAvailable, &CVEngineServer::PersistenceAvailable);
}
void HVEngineServer::Detach() const
{
DetourDetach(&IVEngineServer__PersistenceAvailable, &CVEngineServer::PersistenceAvailable);
}
///////////////////////////////////////////////////////////////////////////////
ServerPlayer_t g_ServerPlayer[MAX_PLAYERS];
IVEngineServer* g_pEngineServerVFTable = nullptr;
CVEngineServer* g_pEngineServer = reinterpret_cast<CVEngineServer*>(&g_pEngineServerVFTable);