networking
This commit is contained in:
@@ -38,22 +38,7 @@ void ILevel::LoadLevel( const char *szLevelName )
|
||||
EntityHeader_t* pEntityHeader = (EntityHeader_t*)pData;
|
||||
pData+=sizeof(EntityHeader_t);
|
||||
|
||||
CBaseEntity *pEntity = NULL;
|
||||
for (auto &entity: g_RegisteredEntities)
|
||||
{
|
||||
if (!V_strcmp(entity->m_szName, (char*)szEntityType.GetMemory()))
|
||||
{
|
||||
CBaseEntity *pEnt = entity->m_pfn();
|
||||
g_entities.AppendTail(pEnt);
|
||||
if (entity->m_pClientfn)
|
||||
{
|
||||
pEnt->pClientEntity = entity->m_pClientfn();
|
||||
pEnt->pClientEntity->pEntity = pEnt;
|
||||
}
|
||||
pEntity = pEnt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
CBaseEntity *pEntity = IIEngine::SpawnEntity(szEntityType);
|
||||
if (!pEntity)
|
||||
continue;
|
||||
|
||||
@@ -62,6 +47,7 @@ void ILevel::LoadLevel( const char *szLevelName )
|
||||
CUtlBuffer<char> szParamName(V_strlen(pData)+1);
|
||||
V_strcpy(szParamName, pData);
|
||||
pData+=szParamName.GetSize();
|
||||
|
||||
CUtlBuffer<char> szParamValue(V_strlen(pData)+1);
|
||||
V_strcpy(szParamValue, pData);
|
||||
pData+=szParamValue.GetSize();
|
||||
@@ -71,11 +57,10 @@ void ILevel::LoadLevel( const char *szLevelName )
|
||||
CBrushEntity *pBrush = dynamic_cast<CBrushEntity*>(pEntity);
|
||||
if (!pBrush)
|
||||
{
|
||||
pEntity->Spawn();
|
||||
if (pEntity->pClientEntity)
|
||||
pEntity->pClientEntity->Spawn();
|
||||
IIEngine::InitEntity(pEntity);
|
||||
continue;
|
||||
}
|
||||
|
||||
pBrush->m_mesh = CUtlVector<Triangle_t>(0);
|
||||
for ( uint32_t j = 0; j<pEntityHeader->nTriangles; j++ )
|
||||
{
|
||||
@@ -89,8 +74,6 @@ void ILevel::LoadLevel( const char *szLevelName )
|
||||
pData+=szTextureName.GetSize();
|
||||
pBrush->m_mesh.AppendTail(triangle);
|
||||
};
|
||||
pBrush->Spawn();
|
||||
if (pBrush->pClientEntity)
|
||||
pBrush->pClientEntity->Spawn();
|
||||
IIEngine::InitEntity(pBrush);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user