Client: get actual client entity list object

This commit is contained in:
Kawe Mazidjatari 2024-07-31 15:28:29 +02:00
parent 6782cdc73b
commit 06ca0479b8
3 changed files with 26 additions and 1 deletions

View File

@ -147,6 +147,7 @@
#include "game/client/input.h"
#include "game/client/movehelper_client.h"
#include "game/client/vscript_client.h"
#include "game/client/cliententitylist.h"
#endif // !DEDICATED
#include "public/edict.h"
#ifndef DEDICATED
@ -678,6 +679,7 @@ void DetourRegister() // Register detour classes to be searched and hooked.
REGISTER(V_ViewRender);
REGISTER(VInput);
REGISTER(VMoveHelperClient);
REGISTER(VClientEntityList);
#endif // !DEDICATED
// Public

View File

@ -4,4 +4,4 @@
// Purpose: a global list of all the entities in the game. All iteration through
// entities is done through this object.
//-----------------------------------------------------------------------------
CClientEntityList* g_clientEntityList = nullptr; // todo(amos): obtain game object.
CClientEntityList* g_clientEntityList = nullptr;

View File

@ -62,4 +62,27 @@ COMPILE_TIME_ASSERT(sizeof(CClientEntityList) == 0x3800C0);
inline IClientEntityList* g_pClientEntityList = nullptr;
extern CClientEntityList* g_clientEntityList;
///////////////////////////////////////////////////////////////////////////////
int HSys_Error_Internal(char* fmt, va_list args);
///////////////////////////////////////////////////////////////////////////////
class VClientEntityList : public IDetour
{
virtual void GetAdr(void) const
{
LogVarAdr("g_clientEntityList", g_clientEntityList);
}
virtual void GetFun(void) const { }
virtual void GetVar(void) const
{
g_GameDll.FindPatternSIMD("48 8D 0D ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 44 89 0D").
ResolveRelativeAddressSelf(3, 7).ResolveRelativeAddressSelf(3, 7).GetPtr(g_clientEntityList);
}
virtual void GetCon(void) const { }
virtual void Detour(const bool bAttach) const { };
};
///////////////////////////////////////////////////////////////////////////////
#endif // CLIENTENTITYLIST_H