mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-06 20:37:45 +00:00
refactor(Core): code cleanup (part 1) (#6361)
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
|
||||
#include "BattlegroundRL.h"
|
||||
#include "Language.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
@@ -71,7 +71,7 @@ void BattlegroundRV::PostUpdateImpl(uint32 diff)
|
||||
setTimer(BG_RV_CLOSE_FIRE_TIMER);
|
||||
setState(BG_RV_STATE_CLOSE_FIRE);
|
||||
|
||||
for (BattlegroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (auto itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
if (Player* player = itr->second)
|
||||
{
|
||||
// Demonic Circle Summon
|
||||
@@ -90,16 +90,16 @@ void BattlegroundRV::PostUpdateImpl(uint32 diff)
|
||||
if (totem->GetPositionZ() < 28.0f)
|
||||
TeleportUnitToNewZ(totem, 28.28f, true);
|
||||
|
||||
for (Unit::ControlSet::const_iterator itr = player->m_Controlled.begin(); itr != player->m_Controlled.end(); ++itr)
|
||||
for (auto itr2 = player->m_Controlled.begin(); itr2 != player->m_Controlled.end(); ++itr2)
|
||||
{
|
||||
if ((*itr)->GetPositionZ() < 28.0f)
|
||||
TeleportUnitToNewZ((*itr), 28.28f, true);
|
||||
if ((*itr2)->GetPositionZ() < 28.0f)
|
||||
TeleportUnitToNewZ((*itr2), 28.28f, true);
|
||||
|
||||
// Xinef: override stay position
|
||||
if (CharmInfo* charmInfo = (*itr)->GetCharmInfo())
|
||||
if (CharmInfo* charmInfo = (*itr2)->GetCharmInfo())
|
||||
if (charmInfo->IsAtStay())
|
||||
{
|
||||
(*itr)->StopMovingOnCurrentPos();
|
||||
(*itr2)->StopMovingOnCurrentPos();
|
||||
charmInfo->SaveStayPosition(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,21 +624,28 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, ui
|
||||
case BG_SA_BLUE_GATE:
|
||||
case BG_SA_GREEN_GATE:
|
||||
{
|
||||
GameObject* go = nullptr;
|
||||
if ((go = GetBGObject(BG_SA_RED_GATE)))
|
||||
go->SetDestructibleBuildingModifyState(true);
|
||||
if ((go = GetBGObject(BG_SA_PURPLE_GATE)))
|
||||
go->SetDestructibleBuildingModifyState(true);
|
||||
if (auto redGate = GetBGObject(BG_SA_RED_GATE))
|
||||
{
|
||||
redGate->SetDestructibleBuildingModifyState(true);
|
||||
}
|
||||
if (auto purpleGate = GetBGObject(BG_SA_PURPLE_GATE))
|
||||
{
|
||||
purpleGate->SetDestructibleBuildingModifyState(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BG_SA_RED_GATE:
|
||||
case BG_SA_PURPLE_GATE:
|
||||
if (GameObject* go = GetBGObject(BG_SA_YELLOW_GATE))
|
||||
go->SetDestructibleBuildingModifyState(true);
|
||||
if (auto yellowGate = GetBGObject(BG_SA_YELLOW_GATE))
|
||||
{
|
||||
yellowGate->SetDestructibleBuildingModifyState(true);
|
||||
}
|
||||
break;
|
||||
case BG_SA_YELLOW_GATE:
|
||||
if (GameObject* go = GetBGObject(BG_SA_ANCIENT_GATE))
|
||||
go->SetDestructibleBuildingModifyState(true);
|
||||
if (auto ancientGate = GetBGObject(BG_SA_ANCIENT_GATE))
|
||||
{
|
||||
ancientGate->SetDestructibleBuildingModifyState(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -876,7 +883,7 @@ void BattlegroundSA::EventPlayerClickedOnFlag(Player* Source, GameObject* gameOb
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
|
||||
@@ -996,7 +1003,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
|
||||
default:
|
||||
ABORT();
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "BattlegroundWS.h"
|
||||
#include "Creature.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include "GameObject.h"
|
||||
#include "Language.h"
|
||||
|
||||
Reference in New Issue
Block a user