merge master into wintergrasp and fix build errors. yay me!

This commit is contained in:
Kandera
2012-08-20 13:34:04 -04:00
parent c28a8aafc0
commit 16f2c3a48e
7 changed files with 60 additions and 76 deletions
@@ -23,6 +23,7 @@
#include "ObjectMgr.h"
#include "BattlefieldWG.h"
#include "SpellAuras.h"
#include "Vehicle.h"
enum eWGBfData
{
@@ -221,7 +222,7 @@ bool BattlefieldWG::Update(uint32 diff)
m_saveTimer -= diff;
for (GuidSet::const_iterator itr = m_PlayersIsSpellImu.begin(); itr != m_PlayersIsSpellImu.end(); ++itr)
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
{
if (player->HasAura(SPELL_SPIRITUAL_IMMUNITY))
{
@@ -253,7 +254,7 @@ bool BattlefieldWG::Update(uint32 diff)
for (uint8 team = 0; team < 2; ++team)
for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
for (BfCapturePointMap::iterator cp_itr = m_capturePoints.begin(); cp_itr != m_capturePoints.end(); ++cp_itr)
{
if ((*cp_itr).second->GetCapturePointGo()->GetExactDist2dSq(player) < 22500.0f) // 150*150
@@ -272,7 +273,7 @@ void BattlefieldWG::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_gui
Battlefield::AddPlayerToResurrectQueue(npc_guid, player_guid);
if (IsWarTime())
{
if (Player* player = sObjectMgr->GetPlayer(player_guid))
if (Player* player = sObjectAccessor->FindPlayer(player_guid))
{
if (!player->HasAura(SPELL_SPIRITUAL_IMMUNITY))
{
@@ -337,7 +338,7 @@ void BattlefieldWG::OnBattleStart()
for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
{
// Kick player in orb room, TODO: offline player ?
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
{
float x, y, z;
player->GetPosition(x, y, z);
@@ -469,7 +470,7 @@ void BattlefieldWG::OnBattleEnd(bool endbytimer)
for (GuidSet::const_iterator itr = m_PlayersInWar[GetDefenderTeam()].begin(); itr != m_PlayersInWar[GetDefenderTeam()].end(); ++itr)
{
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
{
player->AddAura(SPELL_ESSENCE_OF_WINTERGRASP, player);
if (player->HasAura(SPELL_LIEUTENANT))
@@ -492,7 +493,7 @@ void BattlefieldWG::OnBattleEnd(bool endbytimer)
}
for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
{
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
{
if (player->HasAura(SPELL_LIEUTENANT))
{
@@ -511,7 +512,7 @@ void BattlefieldWG::OnBattleEnd(bool endbytimer)
{
for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
{
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
{
player->RemoveAura(SPELL_TOWER_CONTROL);
player->RemoveAurasDueToSpell(SPELL_RECRUIT);
@@ -539,7 +540,7 @@ void BattlefieldWG::OnBattleEnd(bool endbytimer)
{
for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
{
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
{
player->RemoveAurasDueToSpell(m_DefenderTeam == TEAM_ALLIANCE ? SPELL_HORDE_CONTROL_PHASE_SHIFT : SPELL_ALLIANCE_CONTROL_PHASE_SHIFT, player->GetGUID());
player->AddAura(m_DefenderTeam == TEAM_HORDE ? SPELL_HORDE_CONTROL_PHASE_SHIFT : SPELL_ALLIANCE_CONTROL_PHASE_SHIFT, player);
@@ -925,7 +926,7 @@ void BattlefieldWG::SendInitWorldStatesToAll()
WorldPacket data = BuildInitWorldStates();
for (uint8 team = 0; team < 2; team++)
for (GuidSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
player->GetSession()->SendPacket(&data);
}
@@ -935,7 +936,7 @@ void BattlefieldWG::BrokenWallOrTower(TeamId team)
{
for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
{
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
IncrementQuest(player, WGQuest[player->GetTeamId()][2], true);
}
}
@@ -952,12 +953,12 @@ void BattlefieldWG::AddBrokenTower(TeamId team)
// Remove buff stack
for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
player->RemoveAuraFromStack(SPELL_TOWER_CONTROL);
// Add buff stack
for (GuidSet::const_iterator itr = m_PlayersInWar[GetDefenderTeam()].begin(); itr != m_PlayersInWar[GetDefenderTeam()].end(); ++itr)
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
{
player->CastSpell(player, SPELL_TOWER_CONTROL, true);
IncrementQuest(player, WGQuest[player->GetTeamId()][3], true);
@@ -1071,7 +1072,7 @@ void BattlefieldWG::UpdateTenacity()
if (team != TEAM_NEUTRAL)
{
for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
if (player->getLevel() >= m_MinLevel)
player->RemoveAurasDueToSpell(SPELL_TENACITY);
@@ -1097,7 +1098,7 @@ void BattlefieldWG::UpdateTenacity()
buff_honor = (newStack < 5) ? 0 : buff_honor;
for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
player->SetAuraStack(SPELL_TENACITY, player, newStack);
for (GuidSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
if (Unit* unit = sObjectAccessor->FindUnit(*itr))
@@ -1107,7 +1108,7 @@ void BattlefieldWG::UpdateTenacity()
if (buff_honor != 0)
{
for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
if (Player* player = sObjectMgr->GetPlayer(*itr))
if (Player* player = sObjectAccessor->FindPlayer(*itr))
player->AddAura(buff_honor, player);
for (GuidSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
if (Unit* unit = sObjectAccessor->FindUnit(*itr))