From 54f7a09a54eafc9b51cbb61539c4e85bc2abdbcb Mon Sep 17 00:00:00 2001 From: wraitii Date: Wed, 10 Jul 2019 18:43:21 +0000 Subject: [PATCH] Unit Motion - make sure units that die while moving don't keep their obstruction Introduced by 70e22e2923. PositionChanged messages sent between MT_Destroy handling in CmpObstruction and the actual destruction of the component could re-recreate an obstruction, which would then live forever in the obstruction manager. This prevents that by de-activating the obstruction when it is destroyed, so that further PositionChanged messages do nothing. Differential Revision: https://code.wildfiregames.com/D2060 This was SVN commit r22451. --- source/simulation2/components/CCmpObstruction.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/simulation2/components/CCmpObstruction.cpp b/source/simulation2/components/CCmpObstruction.cpp index 2522248a3c..c371c90b04 100644 --- a/source/simulation2/components/CCmpObstruction.cpp +++ b/source/simulation2/components/CCmpObstruction.cpp @@ -363,6 +363,8 @@ public: if (!cmpObstructionManager) break; // error + // Deactivate the obstruction in case PositionChanged messages are sent after this. + m_Active = false; cmpObstructionManager->RemoveShape(m_Tag); m_Tag = tag_t(); if(m_Type == CLUSTER)