diff --git a/Client/mods/deathmatch/logic/CClientRenderElementManager.cpp b/Client/mods/deathmatch/logic/CClientRenderElementManager.cpp index 74c1789e49..a7cb69a155 100644 --- a/Client/mods/deathmatch/logic/CClientRenderElementManager.cpp +++ b/Client/mods/deathmatch/logic/CClientRenderElementManager.cpp @@ -295,6 +295,8 @@ CClientTexture* CClientRenderElementManager::FindAutoTexture(const SString& strF if (!pNewTextureElement) return nullptr; + pNewTextureElement->MakeSystemEntity(); + // Add to automap if created MapSet(m_AutoTextureMap, strUniqueName, SAutoTexture{pNewTextureElement}); ppTextureElement = MapFind(m_AutoTextureMap, strUniqueName); @@ -390,5 +392,5 @@ void CClientRenderElementManager::DoPulse() } for (CClientTexture* texture : deleteCandidates) - g_pClientGame->GetElementDeleter()->Delete(texture, true); + g_pClientGame->GetElementDeleter()->Delete(texture); } diff --git a/Client/mods/deathmatch/logic/CElementDeleter.cpp b/Client/mods/deathmatch/logic/CElementDeleter.cpp index 39e8dff594..147fa4835a 100644 --- a/Client/mods/deathmatch/logic/CElementDeleter.cpp +++ b/Client/mods/deathmatch/logic/CElementDeleter.cpp @@ -19,17 +19,14 @@ CElementDeleter::CElementDeleter() m_bAllowUnreference = true; } -void CElementDeleter::Delete(class CClientEntity* pElement, bool silent) +void CElementDeleter::Delete(class CClientEntity* pElement) { // Make sure we don't try to delete it twice if (pElement && !IsBeingDeleted(pElement)) { // Before we do anything, fire the on-destroy event - if (!silent) - { - CLuaArguments Arguments; - pElement->CallEvent("onClientElementDestroy", Arguments, true); - } + CLuaArguments Arguments; + pElement->CallEvent("onClientElementDestroy", Arguments, true); // Add it to our list if (!pElement->IsBeingDeleted()) diff --git a/Client/mods/deathmatch/logic/CElementDeleter.h b/Client/mods/deathmatch/logic/CElementDeleter.h index a77ca11bc0..a7d1e97c1a 100644 --- a/Client/mods/deathmatch/logic/CElementDeleter.h +++ b/Client/mods/deathmatch/logic/CElementDeleter.h @@ -20,7 +20,7 @@ class CElementDeleter CElementDeleter(); ~CElementDeleter() { DoDeleteAll(); }; - void Delete(class CClientEntity* pElement, bool silent = false); + void Delete(class CClientEntity* pElement); void DeleteRecursive(class CClientEntity* pElement); void DoDeleteAll(); bool IsBeingDeleted(class CClientEntity* pElement);