networking i guess
This commit is contained in:
@@ -81,10 +81,30 @@ C_BaseEntity *CEntitySystem::CreateByClassname( const char *szName )
|
||||
}
|
||||
|
||||
pEntity = pFactory->Create();
|
||||
pEntity->m_szClassName = szName;
|
||||
m_pEntities[iSelectedSlot] = pEntity;
|
||||
m_nEntityCount++;
|
||||
return pEntity;
|
||||
}
|
||||
C_BaseEntity *CEntitySystem::CreateByClassnameWithIndex( const char *szName, uint32_t uIndex )
|
||||
{
|
||||
IEntityFactory *pFactory;
|
||||
C_BaseEntity *pEntity;
|
||||
|
||||
// Do not create such shit
|
||||
if (uIndex >= MAX_EDICTS)
|
||||
return NULL;
|
||||
|
||||
pFactory = GetFactoryByClassname(szName);
|
||||
if ( !pFactory )
|
||||
return NULL;
|
||||
|
||||
pEntity = pFactory->Create();
|
||||
pEntity->m_szClassName = szName;
|
||||
m_pEntities[uIndex] = pEntity;
|
||||
m_nEntityCount++;
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
IEntityFactory *CEntitySystem::GetFactoryByClassname( const char *szName )
|
||||
{
|
||||
@@ -118,3 +138,8 @@ void CEntitySystem::Think()
|
||||
(pEntity->*pEntity->m_pfnThink)(0);
|
||||
}
|
||||
}
|
||||
|
||||
C_BaseEntity **CEntitySystem::GetEntities()
|
||||
{
|
||||
return m_pEntities;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user