forked from mirrors/0ad
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user