Merge pull request #70 from VoiDeD/classname-no-world-entity

GetEntityClassname should handle the case where the world entity has not been created yet (r=psychonic).
This commit is contained in:
Nicholas Hastings 2014-07-06 11:26:01 -04:00
commit 63aeeb8672

View File

@ -1170,6 +1170,12 @@ const char *CHalfLife2::GetEntityClassname(CBaseEntity *pEntity)
if (offset == -1)
{
CBaseEntity *pGetterEnt = ReferenceToEntity(0);
if (pGetterEnt == NULL)
{
// If we don't have a world entity yet, we'll have to rely on the given entity
pGetterEnt = pEntity;
}
datamap_t *pMap = GetDataMap(pGetterEnt);
sm_datatable_info_t info;