networking i guess

This commit is contained in:
2026-02-28 21:07:44 +02:00
parent e83f7cd448
commit 03c560c2b7
68 changed files with 1348 additions and 121 deletions

View File

@@ -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;
};