better physics
This commit is contained in:
@@ -20,12 +20,12 @@ void C_BaseModelEntity::Think( float fDelta )
|
||||
|
||||
void C_BaseModelEntity::SetModel( const char *szName )
|
||||
{
|
||||
if (m_uModelIndex)
|
||||
if (m_hModelHandle)
|
||||
{
|
||||
g_pAssetManager->UnrefModel(m_uModelIndex);
|
||||
g_pAssetManager->UnrefModel(m_hModelHandle);
|
||||
}
|
||||
m_uModelIndex = g_pAssetManager->LoadModel(szName);
|
||||
m_pModel = g_pAssetManager->GetModelByIndex(m_uModelIndex);
|
||||
m_hModelHandle = g_pAssetManager->LoadModel(szName);
|
||||
m_pModel = g_pAssetManager->GetModelByIndex(m_hModelHandle);
|
||||
|
||||
FunnyMesh_t *pMesh = g_pAssetManager->GetMeshByIndex(m_pModel->m_hMesh);
|
||||
m_pInstance = g_pWorldRenderer->CreateInstance(pMesh->m_pMesh);
|
||||
@@ -35,7 +35,7 @@ C_BaseModelEntity::~C_BaseModelEntity()
|
||||
{
|
||||
FunnyMesh_t *pMesh = g_pAssetManager->GetMeshByIndex(m_pModel->m_hMesh);
|
||||
g_pWorldRenderer->DestroyMeshInstance(pMesh->m_pMesh, m_pInstance);
|
||||
g_pAssetManager->UnrefModel(m_uModelIndex);
|
||||
g_pAssetManager->UnrefModel(m_hModelHandle);
|
||||
}
|
||||
|
||||
BEGIN_DATADESC(C_BaseModelEntity)
|
||||
|
||||
Reference in New Issue
Block a user