From 8680c6ce0632c1dd0d2e2a95d4e90ccc06131887 Mon Sep 17 00:00:00 2001 From: vts Date: Wed, 28 Mar 2012 23:09:05 +0000 Subject: [PATCH] Delete rally point marker entity when entity is destroyed. Fixes #1254. This was SVN commit r11409. --- .../simulation2/components/CCmpRallyPointRenderer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/simulation2/components/CCmpRallyPointRenderer.cpp b/source/simulation2/components/CCmpRallyPointRenderer.cpp index 64504be57c..dc16628c64 100644 --- a/source/simulation2/components/CCmpRallyPointRenderer.cpp +++ b/source/simulation2/components/CCmpRallyPointRenderer.cpp @@ -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; } }