Core: Fixed more warnings (C6246: Local declaration of 'x' hides declaration of the same name in outer scope.)
This commit is contained in:
@@ -1759,12 +1759,12 @@ void Battleground::HandleKillPlayer(Player* player, Player* killer)
|
||||
|
||||
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!player || player == killer)
|
||||
Player* creditedPlayer = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!creditedPlayer || creditedPlayer == killer)
|
||||
continue;
|
||||
|
||||
if (player->GetTeam() == killer->GetTeam() && player->IsAtGroupRewardDistance(player))
|
||||
UpdatePlayerScore(player, SCORE_HONORABLE_KILLS, 1);
|
||||
if (creditedPlayer->GetTeam() == killer->GetTeam() && creditedPlayer->IsAtGroupRewardDistance(player))
|
||||
UpdatePlayerScore(creditedPlayer, SCORE_HONORABLE_KILLS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -914,43 +914,43 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 diff, BattlegroundTypeId
|
||||
GroupsQueueType::iterator itr_teams[BG_TEAMS_COUNT];
|
||||
uint8 found = 0;
|
||||
uint8 team = 0;
|
||||
|
||||
|
||||
for (uint8 i = BG_QUEUE_PREMADE_ALLIANCE; i < BG_QUEUE_NORMAL_ALLIANCE; i++)
|
||||
{
|
||||
// take the group that joined first
|
||||
GroupsQueueType::iterator itr = m_QueuedGroups[bracket_id][i].begin();
|
||||
for (; itr != m_QueuedGroups[bracket_id][i].end(); ++itr)
|
||||
GroupsQueueType::iterator itr2 = m_QueuedGroups[bracket_id][i].begin();
|
||||
for (; itr2 != m_QueuedGroups[bracket_id][i].end(); ++itr2)
|
||||
{
|
||||
// if group match conditions, then add it to pool
|
||||
if (!(*itr)->IsInvitedToBGInstanceGUID
|
||||
&& (((*itr)->ArenaMatchmakerRating >= arenaMinRating && (*itr)->ArenaMatchmakerRating <= arenaMaxRating)
|
||||
|| (*itr)->JoinTime < discardTime))
|
||||
if (!(*itr2)->IsInvitedToBGInstanceGUID
|
||||
&& (((*itr2)->ArenaMatchmakerRating >= arenaMinRating && (*itr2)->ArenaMatchmakerRating <= arenaMaxRating)
|
||||
|| (*itr2)->JoinTime < discardTime))
|
||||
{
|
||||
itr_teams[found++] = itr;
|
||||
itr_teams[found++] = itr2;
|
||||
team = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!found)
|
||||
return;
|
||||
|
||||
|
||||
if (found == 1)
|
||||
{
|
||||
for (GroupsQueueType::iterator itr = itr_teams[0]; itr != m_QueuedGroups[bracket_id][team].end(); ++itr)
|
||||
for (GroupsQueueType::iterator itr3 = itr_teams[0]; itr3 != m_QueuedGroups[bracket_id][team].end(); ++itr3)
|
||||
{
|
||||
if (!(*itr)->IsInvitedToBGInstanceGUID
|
||||
&& (((*itr)->ArenaMatchmakerRating >= arenaMinRating && (*itr)->ArenaMatchmakerRating <= arenaMaxRating)
|
||||
|| (*itr)->JoinTime < discardTime)
|
||||
&& (*itr_teams[0])->ArenaTeamId != (*itr)->ArenaTeamId)
|
||||
if (!(*itr3)->IsInvitedToBGInstanceGUID
|
||||
&& (((*itr3)->ArenaMatchmakerRating >= arenaMinRating && (*itr3)->ArenaMatchmakerRating <= arenaMaxRating)
|
||||
|| (*itr3)->JoinTime < discardTime)
|
||||
&& (*itr_teams[0])->ArenaTeamId != (*itr3)->ArenaTeamId)
|
||||
{
|
||||
itr_teams[found++] = itr;
|
||||
itr_teams[found++] = itr3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//if we have 2 teams, then start new arena and invite players!
|
||||
if (found == 2)
|
||||
{
|
||||
@@ -962,14 +962,14 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 diff, BattlegroundTypeId
|
||||
sLog->outError("BattlegroundQueue::Update couldn't create arena instance for rated arena match!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
aTeam->OpponentsTeamRating = hTeam->ArenaTeamRating;
|
||||
hTeam->OpponentsTeamRating = aTeam->ArenaTeamRating;
|
||||
aTeam->OpponentsMatchmakerRating = hTeam->ArenaMatchmakerRating;
|
||||
hTeam->OpponentsMatchmakerRating = aTeam->ArenaMatchmakerRating;
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "setting oposite teamrating for team %u to %u", aTeam->ArenaTeamId, aTeam->OpponentsTeamRating);
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "setting oposite teamrating for team %u to %u", hTeam->ArenaTeamId, hTeam->OpponentsTeamRating);
|
||||
|
||||
|
||||
// now we must move team if we changed its faction to another faction queue, because then we will spam log by errors in Queue::RemovePlayer
|
||||
if (aTeam->Team != ALLIANCE)
|
||||
{
|
||||
@@ -981,12 +981,12 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 diff, BattlegroundTypeId
|
||||
m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].push_front(hTeam);
|
||||
m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].erase(itr_teams[BG_TEAM_HORDE]);
|
||||
}
|
||||
|
||||
|
||||
arena->SetArenaMatchmakerRating(ALLIANCE, aTeam->ArenaMatchmakerRating);
|
||||
arena->SetArenaMatchmakerRating( HORDE, hTeam->ArenaMatchmakerRating);
|
||||
InviteGroupToBG(aTeam, arena, ALLIANCE);
|
||||
InviteGroupToBG(hTeam, arena, HORDE);
|
||||
|
||||
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Starting rated arena match!");
|
||||
arena->StartBattleground();
|
||||
}
|
||||
|
||||
@@ -1348,23 +1348,23 @@ bool BattlegroundAV::SetupBattleground()
|
||||
|
||||
//creatures
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV start poputlating nodes");
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
|
||||
for (i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
|
||||
{
|
||||
if (m_Nodes[i].Owner)
|
||||
PopulateNode(i);
|
||||
PopulateNode(BG_AV_Nodes(i));
|
||||
}
|
||||
//all creatures which don't get despawned through the script are static
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning static creatures");
|
||||
for (i=0; i < AV_STATICCPLACE_MAX; i++)
|
||||
AddAVCreature(0, i+AV_CPLACE_MAX);
|
||||
for (i = 0; i < AV_STATICCPLACE_MAX; i++)
|
||||
AddAVCreature(0, i + AV_CPLACE_MAX);
|
||||
//mainspiritguides:
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning spiritguides creatures");
|
||||
AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], ALLIANCE);
|
||||
AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], HORDE);
|
||||
//spawn the marshals (those who get deleted, if a tower gets destroyed)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning marshal creatures");
|
||||
for (i=AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++)
|
||||
AddAVCreature(i, AV_CPLACE_A_MARSHAL_SOUTH+(i-AV_NPC_A_MARSHAL_SOUTH));
|
||||
for (i = AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++)
|
||||
AddAVCreature(i, AV_CPLACE_A_MARSHAL_SOUTH + (i - AV_NPC_A_MARSHAL_SOUTH));
|
||||
AddAVCreature(AV_NPC_HERALD, AV_CPLACE_HERALD);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user