Get GetEntityClassname m_iClassname offset from worldspawn (bug 5654, r=asherkin).

This commit is contained in:
Nicholas Hastings 2013-03-16 22:57:33 -04:00
parent 3e41d9b794
commit 14a8f4a728

View File

@ -1145,7 +1145,8 @@ const char *CHalfLife2::GetEntityClassname(CBaseEntity *pEntity)
static int offset = -1;
if (offset == -1)
{
datamap_t *pMap = GetDataMap(pEntity);
CBaseEntity *pGetterEnt = ReferenceToEntity(0);
datamap_t *pMap = GetDataMap(pGetterEnt);
typedescription_t *pDesc = FindInDataMap(pMap, "m_iClassname");
offset = GetTypeDescOffs(pDesc);
}