GetEntityClassname should handle the case where the world entity has not been created yet.

This commit is contained in:
Ryan Stecker 2014-07-05 10:37:16 -05:00
parent 3f220bca0d
commit 3c079bcca0

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;