Core: Codestyle cleanup
This commit is contained in:
@@ -1373,7 +1373,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
|
||||
// Must be created this way, adding to godatamap would add it to the base map of the instance
|
||||
// and when loading it (in go::LoadFromDB()), a new guid would be assigned to the object, and a new object would be created
|
||||
// So we must create it specific for this instance
|
||||
GameObject * go = new GameObject;
|
||||
GameObject* go = new GameObject;
|
||||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, GetBgMap(),
|
||||
PHASEMASK_NORMAL, x, y, z, o, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
|
||||
{
|
||||
|
||||
@@ -557,7 +557,7 @@ class Battleground
|
||||
//to be removed
|
||||
const char* GetTrinityString(int32 entry);
|
||||
|
||||
virtual bool HandlePlayerUnderMap(Player * /*plr*/) { return false; }
|
||||
virtual bool HandlePlayerUnderMap(Player* /*plr*/) { return false; }
|
||||
|
||||
// since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
|
||||
uint32 GetPlayerTeam(const uint64& guid) const;
|
||||
@@ -591,7 +591,7 @@ class Battleground
|
||||
// Scorekeeping
|
||||
BattlegroundScoreMap m_PlayerScores; // Player scores
|
||||
// must be implemented in BG subclass
|
||||
virtual void RemovePlayer(Player * /*player*/, uint64 /*guid*/) {}
|
||||
virtual void RemovePlayer(Player* /*player*/, uint64 /*guid*/) {}
|
||||
|
||||
// Player lists, those need to be accessible by inherited classes
|
||||
BattlegroundPlayerMap m_Players;
|
||||
|
||||
@@ -70,7 +70,7 @@ void BattlegroundMgr::DeleteAllBattlegrounds()
|
||||
{
|
||||
for (BattlegroundSet::iterator itr = m_Battlegrounds[i].begin(); itr != m_Battlegrounds[i].end();)
|
||||
{
|
||||
Battleground * bg = itr->second;
|
||||
Battleground* bg = itr->second;
|
||||
m_Battlegrounds[i].erase(itr++);
|
||||
if (!m_ClientBattlegroundIds[i][bg->GetBracketId()].empty())
|
||||
m_ClientBattlegroundIds[i][bg->GetBracketId()].erase(bg->GetClientInstanceID());
|
||||
@@ -106,7 +106,7 @@ void BattlegroundMgr::Update(uint32 diff)
|
||||
// direct deletion caused crashes
|
||||
if (itr->second->m_SetDeleteThis)
|
||||
{
|
||||
Battleground * bg = itr->second;
|
||||
Battleground* bg = itr->second;
|
||||
m_Battlegrounds[i].erase(itr);
|
||||
if (!m_ClientBattlegroundIds[i][bg->GetBracketId()].empty())
|
||||
m_ClientBattlegroundIds[i][bg->GetBracketId()].erase(bg->GetClientInstanceID());
|
||||
@@ -429,7 +429,7 @@ void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket *data, Pla
|
||||
*data << uint64(plr->GetGUID());
|
||||
}
|
||||
|
||||
Battleground * BattlegroundMgr::GetBattlegroundThroughClientInstance(uint32 instanceId, BattlegroundTypeId bgTypeId)
|
||||
Battleground* BattlegroundMgr::GetBattlegroundThroughClientInstance(uint32 instanceId, BattlegroundTypeId bgTypeId)
|
||||
{
|
||||
//cause at HandleBattlegroundJoinOpcode the clients sends the instanceid he gets from
|
||||
//SMSG_BATTLEFIELD_LIST we need to find the battleground with this clientinstance-id
|
||||
@@ -448,7 +448,7 @@ Battleground * BattlegroundMgr::GetBattlegroundThroughClientInstance(uint32 inst
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Battleground * BattlegroundMgr::GetBattleground(uint32 InstanceID, BattlegroundTypeId bgTypeId)
|
||||
Battleground* BattlegroundMgr::GetBattleground(uint32 InstanceID, BattlegroundTypeId bgTypeId)
|
||||
{
|
||||
if (!InstanceID)
|
||||
return NULL;
|
||||
@@ -468,7 +468,7 @@ Battleground * BattlegroundMgr::GetBattleground(uint32 InstanceID, BattlegroundT
|
||||
return ((itr != m_Battlegrounds[bgTypeId].end()) ? itr->second : NULL);
|
||||
}
|
||||
|
||||
Battleground * BattlegroundMgr::GetBattlegroundTemplate(BattlegroundTypeId bgTypeId)
|
||||
Battleground* BattlegroundMgr::GetBattlegroundTemplate(BattlegroundTypeId bgTypeId)
|
||||
{
|
||||
//map is sorted and we can be sure that lowest instance id has only BG template
|
||||
return m_Battlegrounds[bgTypeId].empty() ? NULL : m_Battlegrounds[bgTypeId].begin()->second;
|
||||
@@ -497,7 +497,7 @@ uint32 BattlegroundMgr::CreateClientVisibleInstanceId(BattlegroundTypeId bgTypeI
|
||||
}
|
||||
|
||||
// create a new battleground that will really be used to play
|
||||
Battleground * BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 arenaType, bool isRated)
|
||||
Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 arenaType, bool isRated)
|
||||
{
|
||||
// get the template BG
|
||||
Battleground *bg_template = GetBattlegroundTemplate(bgTypeId);
|
||||
@@ -1026,7 +1026,7 @@ void BattlegroundMgr::SetHolidayWeekends(uint32 mask)
|
||||
{
|
||||
for (uint32 bgtype = 1; bgtype < MAX_BATTLEGROUND_TYPE_ID; ++bgtype)
|
||||
{
|
||||
if (Battleground * bg = GetBattlegroundTemplate(BattlegroundTypeId(bgtype)))
|
||||
if (Battleground* bg = GetBattlegroundTemplate(BattlegroundTypeId(bgtype)))
|
||||
{
|
||||
bg->SetHoliday(mask & (1 << bgtype));
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
// first send removal information
|
||||
if (Player *plr2 = sObjectMgr->GetPlayer(group->Players.begin()->first))
|
||||
{
|
||||
Battleground * bg = sBattlegroundMgr->GetBattlegroundTemplate(group->BgTypeId);
|
||||
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(group->BgTypeId);
|
||||
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(group->BgTypeId, group->ArenaType);
|
||||
uint32 queueSlot = plr2->GetBattlegroundQueueIndex(bgQueueTypeId);
|
||||
plr2->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to
|
||||
@@ -422,7 +422,7 @@ bool BattlegroundQueue::GetPlayerGroupInfoData(const uint64& guid, GroupQueueInf
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * bg, uint32 side)
|
||||
bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground* bg, uint32 side)
|
||||
{
|
||||
// set side if needed
|
||||
if (side)
|
||||
@@ -777,7 +777,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
|
||||
|
||||
// finished iterating through the bgs with free slots, maybe we need to create a new bg
|
||||
|
||||
Battleground * bg_template = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
|
||||
Battleground* bg_template = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
|
||||
if (!bg_template)
|
||||
{
|
||||
sLog->outError("Battleground: Update: bg template not found for %u", bgTypeId);
|
||||
@@ -835,7 +835,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
|
||||
if (CheckPremadeMatch(bracket_id, MinPlayersPerTeam, MaxPlayersPerTeam))
|
||||
{
|
||||
//create new battleground
|
||||
Battleground * bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, 0, false);
|
||||
Battleground* bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, 0, false);
|
||||
if (!bg2)
|
||||
{
|
||||
sLog->outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
|
||||
@@ -861,7 +861,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
|
||||
|| (bg_template->isArena() && CheckSkirmishForSameFaction(bracket_id, MinPlayersPerTeam)))
|
||||
{
|
||||
// we successfully created a pool
|
||||
Battleground * bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, false);
|
||||
Battleground* bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, false);
|
||||
if (!bg2)
|
||||
{
|
||||
sLog->outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
|
||||
|
||||
@@ -118,7 +118,7 @@ class BattlegroundQueue
|
||||
|
||||
private:
|
||||
|
||||
bool InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * bg, uint32 side);
|
||||
bool InviteGroupToBG(GroupQueueInfo * ginfo, Battleground* bg, uint32 side);
|
||||
uint32 m_WaitTimes[BG_TEAMS_COUNT][MAX_BATTLEGROUND_BRACKETS][COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME];
|
||||
uint32 m_WaitTimeLastPlayer[BG_TEAMS_COUNT][MAX_BATTLEGROUND_BRACKETS];
|
||||
uint32 m_SumOfWaitTimes[BG_TEAMS_COUNT][MAX_BATTLEGROUND_BRACKETS];
|
||||
|
||||
@@ -62,7 +62,7 @@ void BattlegroundAA::AddPlayer(Player *plr)
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
}
|
||||
|
||||
void BattlegroundAA::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundAA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ void BattlegroundAA::HandleKillPlayer(Player* player, Player* killer)
|
||||
Battleground::HandleKillPlayer(player, killer);
|
||||
}
|
||||
|
||||
void BattlegroundAA::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
void BattlegroundAA::HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ void BattlegroundAB::AddPlayer(Player *plr)
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
}
|
||||
|
||||
void BattlegroundAB::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundAB::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class BattlegroundBE : public Battleground
|
||||
virtual void Reset();
|
||||
virtual void FillInitialWorldStates(WorldPacket &d);
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
bool HandlePlayerUnderMap(Player * plr);
|
||||
bool HandlePlayerUnderMap(Player* plr);
|
||||
|
||||
/* Scorekeeping */
|
||||
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
|
||||
|
||||
@@ -110,7 +110,7 @@ void BattlegroundDS::AddPlayer(Player *plr)
|
||||
UpdateArenaWorldState();
|
||||
}
|
||||
|
||||
void BattlegroundDS::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundDS::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return;
|
||||
|
||||
@@ -77,7 +77,7 @@ class BattlegroundDS : public Battleground
|
||||
virtual void Reset();
|
||||
virtual void FillInitialWorldStates(WorldPacket &d);
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
bool HandlePlayerUnderMap(Player * plr);
|
||||
bool HandlePlayerUnderMap(Player* plr);
|
||||
private:
|
||||
uint32 m_waterTimer;
|
||||
bool m_waterfallActive;
|
||||
|
||||
@@ -370,7 +370,7 @@ class BattlegroundEY : public Battleground
|
||||
bool IsAllNodesConrolledByTeam(uint32 team) const;
|
||||
private:
|
||||
void EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType);
|
||||
void EventPlayerCapturedFlag(Player * /*Source*/) {}
|
||||
void EventPlayerCapturedFlag(Player* /*Source*/) {}
|
||||
void EventTeamCapturedPoint(Player *Source, uint32 Point);
|
||||
void EventTeamLostPoint(Player *Source, uint32 Point);
|
||||
void UpdatePointsCount(uint32 Team);
|
||||
|
||||
@@ -316,7 +316,7 @@ void BattlegroundIC::RemovePlayer(Player* plr, uint64 /*guid*/)
|
||||
plr->RemoveAura(SPELL_OIL_REFINERY);
|
||||
}
|
||||
|
||||
void BattlegroundIC::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
void BattlegroundIC::HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
|
||||
@@ -69,6 +69,6 @@ class BattlegroundNA : public Battleground
|
||||
virtual void Reset();
|
||||
virtual void FillInitialWorldStates(WorldPacket &d);
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
bool HandlePlayerUnderMap(Player * plr);
|
||||
bool HandlePlayerUnderMap(Player* plr);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -61,7 +61,7 @@ void BattlegroundRB::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
}
|
||||
|
||||
void BattlegroundRB::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
void BattlegroundRB::HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
|
||||
@@ -65,6 +65,6 @@ class BattlegroundRL : public Battleground
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleground();
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
bool HandlePlayerUnderMap(Player * plr);
|
||||
bool HandlePlayerUnderMap(Player* plr);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -131,7 +131,7 @@ void BattlegroundRV::AddPlayer(Player *plr)
|
||||
UpdateWorldState(BG_RV_WORLD_STATE_H, GetAlivePlayersCountByTeam(HORDE));
|
||||
}
|
||||
|
||||
void BattlegroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundRV::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return;
|
||||
|
||||
@@ -122,7 +122,7 @@ class BattlegroundRV : public Battleground
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleground();
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
bool HandlePlayerUnderMap(Player * plr);
|
||||
bool HandlePlayerUnderMap(Player* plr);
|
||||
|
||||
private:
|
||||
uint32 Timer;
|
||||
|
||||
@@ -469,7 +469,7 @@ void BattlegroundSA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
}
|
||||
|
||||
void BattlegroundSA::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
void BattlegroundSA::HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
@@ -912,7 +912,7 @@ void BattlegroundSA::SendTransportInit(Player *player)
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundSA::SendTransportsRemove(Player * player)
|
||||
void BattlegroundSA::SendTransportsRemove(Player* player)
|
||||
{
|
||||
if (m_BgObjects[BG_SA_BOAT_ONE] || m_BgObjects[BG_SA_BOAT_TWO])
|
||||
{
|
||||
|
||||
@@ -538,7 +538,7 @@ class BattlegroundSA : public Battleground
|
||||
/// Send packet to player for create boats (client part)
|
||||
void SendTransportInit(Player *player);
|
||||
/// Send packet to player for destroy boats (client part)
|
||||
void SendTransportsRemove(Player * player);
|
||||
void SendTransportsRemove(Player* player);
|
||||
|
||||
/// Id of attacker team
|
||||
TeamId Attackers;
|
||||
|
||||
@@ -142,20 +142,20 @@ void BattlegroundWS::Update(uint32 diff)
|
||||
m_FlagSpellForceTimer += diff;
|
||||
if (m_FlagDebuffState == 0 && m_FlagSpellForceTimer >= 600000) //10 minutes
|
||||
{
|
||||
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))
|
||||
if (Player* plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))
|
||||
plr->CastSpell(plr, WS_SPELL_FOCUSED_ASSAULT, true);
|
||||
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))
|
||||
if (Player* plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))
|
||||
plr->CastSpell(plr, WS_SPELL_FOCUSED_ASSAULT, true);
|
||||
m_FlagDebuffState = 1;
|
||||
}
|
||||
else if (m_FlagDebuffState == 1 && m_FlagSpellForceTimer >= 900000) //15 minutes
|
||||
{
|
||||
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))
|
||||
if (Player* plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
|
||||
plr->CastSpell(plr, WS_SPELL_BRUTAL_ASSAULT, true);
|
||||
}
|
||||
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))
|
||||
if (Player* plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
|
||||
plr->CastSpell(plr, WS_SPELL_BRUTAL_ASSAULT, true);
|
||||
|
||||
Reference in New Issue
Block a user