diff --git a/include/Game/Systems/CapturePointSystem.h b/include/Game/Systems/CapturePointSystem.h index 542d80d5..2d28c003 100644 --- a/include/Game/Systems/CapturePointSystem.h +++ b/include/Game/Systems/CapturePointSystem.h @@ -44,7 +44,6 @@ private: //std::vector - std::map m_NextPossibleCapturePoint; const double m_CaptureTimeToTakeOver = 15.0; //vectors which will keep track of enter/leave changes diff --git a/resources/Schema/Entities/Empty.xml b/resources/Schema/Entities/Empty.xml index d550bbfe..6efd8318 100644 --- a/resources/Schema/Entities/Empty.xml +++ b/resources/Schema/Entities/Empty.xml @@ -5,52 +5,6 @@ - - - - - - - - - - - - - - - -0.049999997019767761 - - - ../assets/Models/Core/UnitBox.obj - - - - - - - - - - - - - - - - - - - - - - - ../assets/Models/DummyScene.obj - - - - - - + diff --git a/src/Game/Systems/CapturePointSystem.cpp b/src/Game/Systems/CapturePointSystem.cpp index e5141cdf..ef68ccdd 100644 --- a/src/Game/Systems/CapturePointSystem.cpp +++ b/src/Game/Systems/CapturePointSystem.cpp @@ -57,34 +57,35 @@ void CapturePointSystem::UpdateComponent(World* world, EntityWrapper& entity, Co } //calculate next possible capturePoint for both teams - m_NextPossibleCapturePoint["Red"] = -1; - m_NextPossibleCapturePoint["Blue"] = -1; + std::map nextPossibleCapturePoint; + nextPossibleCapturePoint["Red"] = -1; + nextPossibleCapturePoint["Blue"] = -1; for (size_t i = 0; i < m_NumberOfCapturePoints; i++) { ComponentWrapper& capturePointOwnedBy = world->GetComponent(m_CapturePointNumberToEntityIDMap[i], "Team"); if ((int)capturePointOwnedBy["Team"] == redTeam && m_RedTeamHomeCapturePoint == 0) { - m_NextPossibleCapturePoint["Red"] = i + 1; + nextPossibleCapturePoint["Red"] = i + 1; } if ((int)capturePointOwnedBy["Team"] == blueTeam && m_BlueTeamHomeCapturePoint == 0) { - m_NextPossibleCapturePoint["Blue"] = i + 1; + nextPossibleCapturePoint["Blue"] = i + 1; } } for (int i = m_NumberOfCapturePoints - 1; i >= 0; i--) { ComponentWrapper& capturePointOwnedBy = world->GetComponent(m_CapturePointNumberToEntityIDMap[i], "Team"); if ((int)capturePointOwnedBy["Team"] == redTeam && m_RedTeamHomeCapturePoint != 0) { - m_NextPossibleCapturePoint["Red"] = i - 1; + nextPossibleCapturePoint["Red"] = i - 1; } if ((int)capturePointOwnedBy["Team"] == blueTeam && m_BlueTeamHomeCapturePoint != 0) { - m_NextPossibleCapturePoint["Blue"] = i - 1; + nextPossibleCapturePoint["Blue"] = i - 1; } } //colorize next possible capturepoint - if (m_NextPossibleCapturePoint["Red"] == capturePointNumber) { + if (nextPossibleCapturePoint["Red"] == capturePointNumber) { entity["Model"]["Color"] = glm::vec4(1, 1, 0, 1); } - if (m_NextPossibleCapturePoint["Blue"] == capturePointNumber) { + if (nextPossibleCapturePoint["Blue"] == capturePointNumber) { entity["Model"]["Color"] = glm::vec4(0, 1, 1, 1); } @@ -127,12 +128,12 @@ void CapturePointSystem::UpdateComponent(World* world, EntityWrapper& entity, Co if (redTeamPlayersStandingInside > 0 && blueTeamPlayersStandingInside == 0) { timerDeltaChange = redTeamPlayersStandingInside*dt; currentTeam = redTeam; - canCapture = m_NextPossibleCapturePoint["Red"] == capturePointNumber; + canCapture = nextPossibleCapturePoint["Red"] == capturePointNumber; } if (redTeamPlayersStandingInside == 0 && blueTeamPlayersStandingInside > 0) { timerDeltaChange = -blueTeamPlayersStandingInside*dt; currentTeam = blueTeam; - canCapture = m_NextPossibleCapturePoint["Blue"] == capturePointNumber; + canCapture = nextPossibleCapturePoint["Blue"] == capturePointNumber; } if (redTeamPlayersStandingInside == 0 && blueTeamPlayersStandingInside == 0) {