From c060b01037646303c7db944cbbb1fd37566b8fc5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 14 Dec 2021 16:24:48 +0100 Subject: [PATCH] fix undeleted dpEntity after enemy smashed could be the cause of long-soak (hours long) sessions having CPU issues --- dGame/dComponents/BaseCombatAIComponent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dGame/dComponents/BaseCombatAIComponent.cpp b/dGame/dComponents/BaseCombatAIComponent.cpp index 44154f52..ae929d57 100644 --- a/dGame/dComponents/BaseCombatAIComponent.cpp +++ b/dGame/dComponents/BaseCombatAIComponent.cpp @@ -129,6 +129,9 @@ BaseCombatAIComponent::BaseCombatAIComponent(Entity* parent, const uint32_t id) BaseCombatAIComponent::~BaseCombatAIComponent() { if (m_dpEntity) dpWorld::Instance().RemoveEntity(m_dpEntity); + + if (m_dpEntityEnemy) + dpWorld::Instance().RemoveEntity(m_dpEntityEnemy); } void BaseCombatAIComponent::Update(const float deltaTime) {