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.
This commit is contained in:
wraitii 2019-07-10 18:43:21 +00:00
parent bbc2e84160
commit 54f7a09a54

View file

@ -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)