Eliminate need for s_pTempEnts gamedata on sdk2013 and soon css/dods/hl2dm (already on tf2).

This commit is contained in:
Nicholas Hastings 2014-10-30 19:24:53 -04:00
parent 0d69ce8b9a
commit b8e4510f7e

View File

@ -285,9 +285,19 @@ void TempEntityManager::Initialize()
int offset;
m_Loaded = false;
#if SOURCE_ENGINE == SE_TF2
#if SOURCE_ENGINE == SE_TF2 \
|| SOURCE_ENGINE == SE_DODS \
|| SOURCE_ENGINE == SE_HL2DM \
|| SOURCE_ENGINE == SE_CSS \
|| SOURCE_ENGINE == SE_SDK2013
if (g_SMAPI->GetServerFactory(false)("VSERVERTOOLS003", nullptr))
{
m_ListHead = servertools->GetTempEntList();
#else
}
else
#endif
{
/*
* First try to lookup s_pTempEntities directly for platforms with symbols.
* If symbols aren't present (Windows or stripped Linux/Mac),
@ -299,7 +309,7 @@ void TempEntityManager::Initialize()
{
/* Store the head of the TE linked list */
m_ListHead = *(void **)addr;
m_ListHead = *(void **) addr;
}
else if (g_pGameConf->GetMemSig("CBaseTempEntity", &addr) && addr)
{
@ -308,13 +318,13 @@ void TempEntityManager::Initialize()
return;
}
/* Store the head of the TE linked list */
m_ListHead = **(void ***)((unsigned char *)addr + offset);
m_ListHead = **(void ***) ((unsigned char *) addr + offset);
}
else
{
return;
}
#endif // == TF2
}
if (!g_pGameConf->GetOffset("GetTEName", &m_NameOffs))
{