aboutsummaryrefslogtreecommitdiff
path: root/src/game/BattleGroundEY.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/BattleGroundEY.cpp')
-rw-r--r--src/game/BattleGroundEY.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/game/BattleGroundEY.cpp b/src/game/BattleGroundEY.cpp
index 9b54ecce643..78654677230 100644
--- a/src/game/BattleGroundEY.cpp
+++ b/src/game/BattleGroundEY.cpp
@@ -128,7 +128,7 @@ void BattleGroundEY::StartingEventOpenDoors()
void BattleGroundEY::AddPoints(uint32 Team, uint32 Points)
{
- uint8 team_index = GetTeamIndexByTeamId(Team);
+ BattleGroundTeamId team_index = GetTeamIndexByTeamId(Team);
m_TeamScores[team_index] += Points;
m_HonorScoreTics[team_index] += Points;
if (m_HonorScoreTics[team_index] >= m_HonorTics )
@@ -788,8 +788,7 @@ void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType
void BattleGroundEY::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
{
- std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
-
+ BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
if(itr == m_PlayerScores.end()) // player not found
return;
@@ -908,3 +907,12 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
return nearestEntry;
}
+bool BattleGroundEY::IsAllNodesConrolledByTeam(uint32 team) const
+{
+ uint32 count = 0;
+ for(int i = 0; i < EY_POINTS_MAX; ++i)
+ if (m_PointOwnedByTeam[i] == team && m_PointState[i] == EY_POINT_UNDER_CONTROL)
+ ++count;
+
+ return count == EY_POINTS_MAX;
+}