diff --git a/Client/mods/deathmatch/logic/CClientModel.cpp b/Client/mods/deathmatch/logic/CClientModel.cpp index b377332fd8..56bd3f566b 100644 --- a/Client/mods/deathmatch/logic/CClientModel.cpp +++ b/Client/mods/deathmatch/logic/CClientModel.cpp @@ -165,6 +165,9 @@ bool CClientModel::DeallocateDFF(CModelInfo* pModelInfo) // Restore DFF/TXD g_pClientGame->GetManager()->GetDFFManager()->RestoreModel(m_iModelID); + // Remove model info + pModelInfo->DeallocateModel(); + return true; } diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp index da6b13aad5..d821654d17 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp @@ -859,6 +859,7 @@ int CLuaEngineDefs::EngineRequestModel(lua_State* luaVM) int iModelID = m_pManager->GetModelManager()->GetFirstFreeModelID(); if (iModelID != INVALID_MODEL_ID) { std::shared_ptr pModel = m_pManager->GetModelManager()->Request(m_pManager, iModelID, eModelType); + m_pManager->GetModelManager()->Add(pModel); ushort usParentID = -1;