[12148] Improve BattleGroundAB::IsAllNodesControlledByTeam

This commit is contained in:
stfx 2012-08-29 15:56:26 +02:00 committed by Antz
parent caa36a0219
commit e0043ecc56
2 changed files with 5 additions and 6 deletions

View file

@ -563,11 +563,10 @@ void BattleGroundAB::UpdatePlayerScore(Player* source, uint32 type, uint32 value
bool BattleGroundAB::IsAllNodesControlledByTeam(Team team) const
{
uint8 count = 0;
for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i)
if ((team == ALLIANCE && m_Nodes[i] == BG_AB_NODE_STATUS_ALLY_OCCUPIED) ||
(team == HORDE && m_Nodes[i] == BG_AB_NODE_STATUS_HORDE_OCCUPIED))
++count;
if ((team == ALLIANCE && m_Nodes[i] != BG_AB_NODE_STATUS_ALLY_OCCUPIED) ||
(team == HORDE && m_Nodes[i] != BG_AB_NODE_STATUS_HORDE_OCCUPIED))
return false;
return count == BG_AB_NODES_MAX;
return true;
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12147"
#define REVISION_NR "12148"
#endif // __REVISION_NR_H__