Skip to content

Commit a8a441a

Browse files
committed
Temp hack for entity listener
1 parent 041689c commit a8a441a

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/cs2fixes.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,18 @@ void CS2Fixes::Hook_DispatchConCommand(ConCommandRef cmdHandle, const CCommandCo
621621
void CS2Fixes::Hook_StartupServer(const GameSessionConfiguration_t& config, ISource2WorldSession* pSession, const char* pszMapName)
622622
{
623623
g_pEntitySystem = GameEntitySystem();
624-
g_pEntitySystem->AddListenerEntity(g_pEntityListener);
624+
625+
// Temporary hack until CGameEntitySystem is updated in the sdk
626+
#ifdef PLATFORM_LINUX
627+
int offset = 8512;
628+
#else
629+
int offset = 8480;
630+
#endif
631+
632+
auto pListeners = (CUtlVector<IEntityListener*>*)((byte*)g_pEntitySystem + offset);
633+
634+
if (pListeners->Find(g_pEntityListener) == -1)
635+
pListeners->AddToTail(g_pEntityListener);
625636

626637
if (g_pNetworkServerService->GetIGameServer())
627638
g_iSetGameSpawnGroupMgrId = SH_ADD_HOOK(IServer, SetGameSpawnGroupMgr, g_pNetworkServerService->GetIGameServer(), SH_MEMBER(this, &CS2Fixes::Hook_SetGameSpawnGroupMgr), false);

0 commit comments

Comments
 (0)