From 99cdcdf28956a30d4dabab3b6eec69acb6511fee Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Tue, 23 Feb 2016 11:59:18 +0100 Subject: [PATCH] CapturePointSystem now re-reads the CapturePoints if the map has "changed"... --- src/Game/Systems/CapturePointSystem.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Game/Systems/CapturePointSystem.cpp b/src/Game/Systems/CapturePointSystem.cpp index 73e6ac54..4e84f4d4 100644 --- a/src/Game/Systems/CapturePointSystem.cpp +++ b/src/Game/Systems/CapturePointSystem.cpp @@ -25,6 +25,13 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp const int capturePointNumber = cCapturePoint["CapturePointNumber"]; const bool hasTeamComponent = capturePointEntity.HasComponent("Team"); + if (m_NumberOfCapturePoints != 0) { + if (!m_CapturePointNumberToEntityMap[0].HasComponent("CapturePoint")) { + //if map has changed, the capturepoints has changed, now have to redo them + m_NumberOfCapturePoints = 0; + m_CapturePointNumberToEntityMap.clear(); + } + } //if point doesnt have a teamComponent yet, add one. since: //what if capture point has no team -> we cant get/use the team enum from it... if (!hasTeamComponent) {