From 8b89df00955b2c67cff0afa05ab88b9a957fa446 Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Thu, 10 Mar 2016 16:09:54 +0100 Subject: [PATCH] Changed to a better validator --- assets | 2 +- .../Entities/aim_rays_with_capturep.xml | 19 +++++++++++++++++-- src/Game/Systems/CapturePointSystem.cpp | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/assets b/assets index 3af64d8b..007b54bd 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 3af64d8b1f8cdf3e20198b079dfc02f6d64fdc88 +Subproject commit 007b54bd678d0e80af878bed457e33e73bc0834a diff --git a/resources/Schema/Entities/aim_rays_with_capturep.xml b/resources/Schema/Entities/aim_rays_with_capturep.xml index 6aa3246a..3cf5a26a 100644 --- a/resources/Schema/Entities/aim_rays_with_capturep.xml +++ b/resources/Schema/Entities/aim_rays_with_capturep.xml @@ -99,7 +99,7 @@ - Schema/Entities/Player.xml + Schema/Entities/PlayerRed.xml @@ -225,6 +225,11 @@ + + + + false + @@ -239,7 +244,17 @@ - + + + + + + + + + + + diff --git a/src/Game/Systems/CapturePointSystem.cpp b/src/Game/Systems/CapturePointSystem.cpp index 064136a7..13ac59f3 100644 --- a/src/Game/Systems/CapturePointSystem.cpp +++ b/src/Game/Systems/CapturePointSystem.cpp @@ -108,7 +108,7 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp //change what model is displaying (change all in case 2 capturepoints has been captured on the same frame) for (int i = 0; i < m_NumberOfCapturePoints; i++) { auto owner = (int)m_CapturePointNumberToEntityMap[i]["Team"]["Team"]; - if (m_CapturePointNumberToEntityMap[i].FirstChildByName("Red").ID != EntityID_Invalid) { + if (m_CapturePointNumberToEntityMap[i].FirstChildByName("Red").Valid()) { ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Red"), owner == redTeam); ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Blue"), owner == blueTeam); ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Spectator"), owner == spectatorTeam);