Delete rally point marker entity when entity is destroyed. Fixes #1254.

This was SVN commit r11409.
This commit is contained in:
vts
2012-03-28 23:09:05 +00:00
parent e5c85bc540
commit 8680c6ce06
@@ -80,6 +80,7 @@ public:
componentManager.SubscribeToMessageType(MT_RenderSubmit);
componentManager.SubscribeToMessageType(MT_OwnershipChanged);
componentManager.SubscribeToMessageType(MT_TurnStart);
componentManager.SubscribeToMessageType(MT_Destroy);
// TODO: should probably also listen to movement messages (unlikely to happen in-game, but might occur inside atlas)
}
@@ -239,6 +240,15 @@ public:
UpdateOverlayLines(); // check for changes to the SoD and update the overlay lines accordingly
}
break;
case MT_Destroy:
{
if (m_MarkerEntityId != INVALID_ENTITY)
{
GetSimContext().GetComponentManager().DestroyComponentsSoon(m_MarkerEntityId);
m_MarkerEntityId = INVALID_ENTITY;
}
}
break;
}
}