[10781] Use BattleGround(AV)TeamIndex enum types in AV battleground code.

* Added BattleGroundAVTeamIndex enum type for 3-case special team list fo AV.
* Rename BattleGroundTeamId -> BattleGroundTeamIndex for clarify
* Some safe checks added and dropped bogus call RewardReputationToTeam in BattleGroundAV::HandleQuestComplete
  for BattleGroundTeamIndex as faction. Unclear for what it expected used so dropped.
This commit is contained in:
VladimirMangos 2010-11-24 17:27:10 +03:00
parent 26668c067b
commit c2331f58bc
7 changed files with 149 additions and 141 deletions

View file

@ -509,11 +509,11 @@ void BattleGround::Update(uint32 diff)
void BattleGround::SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, float O)
{
BattleGroundTeamId idx = GetTeamIndexByTeamId(TeamID);
m_TeamStartLocX[idx] = X;
m_TeamStartLocY[idx] = Y;
m_TeamStartLocZ[idx] = Z;
m_TeamStartLocO[idx] = O;
BattleGroundTeamIndex teamIdx = GetTeamIndexByTeamId(TeamID);
m_TeamStartLocX[teamIdx] = X;
m_TeamStartLocY[teamIdx] = Y;
m_TeamStartLocZ[teamIdx] = Z;
m_TeamStartLocO[teamIdx] = O;
}
void BattleGround::SendPacketToAll(WorldPacket *packet)
@ -1822,7 +1822,7 @@ WorldSafeLocsEntry const* BattleGround::GetClosestGraveYard( Player* player )
bool BattleGround::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxScore) const
{
BattleGroundTeamId team_idx = GetTeamIndexByTeamId(team);
BattleGroundTeamIndex team_idx = GetTeamIndexByTeamId(team);
uint32 score = (m_TeamScores[team_idx] < 0) ? 0 : uint32(m_TeamScores[team_idx]);
return score >= minScore && score <= maxScore;
}