Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Sep 26, 2024
1 parent bb3d4ee commit 026ff21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions Client/mods/deathmatch/logic/CClientModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ bool CClientModel::Deallocate()
if (!m_bAllocatedByUs)
return false;

if (m_pParentResource)
m_pParentResource->GetResourceModelStreamer()->FullyReleaseModel(m_iModelID);

SetParentResource(nullptr);

CModelInfo* pModelInfo = g_pGame->GetModelInfo(m_iModelID, true);
Expand Down
3 changes: 3 additions & 0 deletions Client/mods/deathmatch/logic/CClientModelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ bool CClientModelManager::Remove(const std::shared_ptr<CClientModel>& pModel)
int modelId = pModel->GetModelID();
if (m_Models[modelId] != nullptr)
{
CResource* perentResource = m_Models[modelId]->GetParentResource();
if (perentResource)
perentResource->GetResourceModelStreamer()->FullyReleaseModel(modelId);
m_Models[modelId]->RestoreEntitiesUsingThisModel();
m_Models[modelId] = nullptr;
m_modelCount--;
Expand Down

0 comments on commit 026ff21

Please sign in to comment.