CapturePointSystem now re-reads the CapturePoints if the map has "changed"...

This commit is contained in:
verysecrethero
2016-02-23 11:59:18 +01:00
parent f1d78ae790
commit 99cdcdf289
+7
View File
@@ -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) {