diff --git a/src/game/AI/GenericSpellAI.cpp b/src/game/AI/GenericSpellAI.cpp index 016f710de..6d9932dc6 100644 --- a/src/game/AI/GenericSpellAI.cpp +++ b/src/game/AI/GenericSpellAI.cpp @@ -157,9 +157,9 @@ struct MANGOS_DLL_DECL GenericSpellMob : public ScriptedAI m_creature->SelectHostileTarget(); if (!m_creature->GetVictim()) return; - /*if(isDistanceCaster) + /*if (isDistanceCaster) { // Check du CoolDown global - if(casterGCD > uiDiff) + if (casterGCD > uiDiff) { // Pas encore pret ! casterGCD -= uiDiff; diff --git a/src/game/AI/PlayerAI.cpp b/src/game/AI/PlayerAI.cpp index 2c78affb8..7dd493d5c 100644 --- a/src/game/AI/PlayerAI.cpp +++ b/src/game/AI/PlayerAI.cpp @@ -247,7 +247,7 @@ void PlayerControlledAI::UpdateTarget(Unit* victim) else { bool inMeleeRange = me->IsWithinMeleeRange(victim); - if ( (bIsMelee && inMeleeRange) || (!bIsMelee && !me->IsMoving() && me->IsWithinDist(victim, 30.0f))) + if ((bIsMelee && inMeleeRange) || (!bIsMelee && !me->IsMoving() && me->IsWithinDist(victim, 30.0f))) { me->GetMotionMaster()->Clear(); if (bIsMelee && !me->HasInArc(0.2f, victim)) @@ -395,7 +395,7 @@ void PlayerControlledAI::UpdateAI(const uint32 uiDiff) { me->CastSpell(spellTarget, spellId, false); uiGlobalCD = 1500; - if(!bIsMelee) + if (!bIsMelee) me->SetCasterChaseDistance(25.0f); } else diff --git a/src/game/AI/ScriptedAI.cpp b/src/game/AI/ScriptedAI.cpp index 3fd554fdb..d9e11f7ea 100644 --- a/src/game/AI/ScriptedAI.cpp +++ b/src/game/AI/ScriptedAI.cpp @@ -178,7 +178,7 @@ void ScriptedAI::DoResetThreat() ThreatList const& tList = m_creature->GetThreatManager().getThreatList(); for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) { - Unit* pUnit = m_creature->GetMap()->GetUnit( (*itr)->getUnitGuid()); + Unit* pUnit = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); if (pUnit && m_creature->GetThreatManager().getThreat(pUnit)) m_creature->GetThreatManager().modifyThreatPercent(pUnit, -100); diff --git a/src/game/AuctionHouse/AuctionHouseBotMgr.h b/src/game/AuctionHouse/AuctionHouseBotMgr.h index a36793ac0..40839895a 100644 --- a/src/game/AuctionHouse/AuctionHouseBotMgr.h +++ b/src/game/AuctionHouse/AuctionHouseBotMgr.h @@ -39,7 +39,7 @@ class AuctionHouseBotMgr // force - put items in AH even if bot is disabled void Update(bool force = false); - void AddItem(AuctionHouseBotEntry e, AuctionHouseObject *auctionHouse ); + void AddItem(AuctionHouseBotEntry e, AuctionHouseObject *auctionHouse); protected: std::vector m_items; diff --git a/src/game/AuctionHouse/AuctionHouseMgr.h b/src/game/AuctionHouse/AuctionHouseMgr.h index 166be046a..4263d0db2 100644 --- a/src/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/game/AuctionHouse/AuctionHouseMgr.h @@ -127,7 +127,7 @@ class AuctionHouseObject AuctionEntry* GetAuction(uint32 id) const { - AuctionEntryMap::const_iterator itr = AuctionsMap.find( id ); + AuctionEntryMap::const_iterator itr = AuctionsMap.find(id); return itr != AuctionsMap.end() ? itr->second : nullptr; } @@ -171,9 +171,9 @@ class AuctionHouseMgr } //auction messages - void SendAuctionWonMail( AuctionEntry * auction ); - void SendAuctionSuccessfulMail( AuctionEntry * auction ); - void SendAuctionExpiredMail( AuctionEntry * auction ); + void SendAuctionWonMail(AuctionEntry * auction); + void SendAuctionSuccessfulMail(AuctionEntry * auction); + void SendAuctionExpiredMail(AuctionEntry * auction); static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item *pItem); static uint32 GetAuctionHouseId(uint32 factionTemplateId); diff --git a/src/game/Battlegrounds/BattleGround.cpp b/src/game/Battlegrounds/BattleGround.cpp index 25064fc4d..e7304f591 100644 --- a/src/game/Battlegrounds/BattleGround.cpp +++ b/src/game/Battlegrounds/BattleGround.cpp @@ -427,7 +427,7 @@ void BattleGround::SetTeamStartLoc(Team team, float X, float Y, float Z, float O m_TeamStartLocO[teamIdx] = O; } -void BattleGround::SendPacketToAll(WorldPacket *packet) +void BattleGround::SendPacketToAll(WorldPacket* packet) { for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) { @@ -438,7 +438,7 @@ void BattleGround::SendPacketToAll(WorldPacket *packet) } } -void BattleGround::SendPacketToTeam(Team teamId, WorldPacket *packet, Player *sender, bool self) +void BattleGround::SendPacketToTeam(Team teamId, WorldPacket* packet, Player* sender, bool self) { for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) { @@ -1070,7 +1070,7 @@ uint32 BattleGround::GetFreeSlotsForTeam(Team team) const if (otherTeam == GetInvitedCount(Team)) diff = 1; // allow join more ppl if the other side has more players - else if(otherTeam > GetInvitedCount(Team)) + else if (otherTeam > GetInvitedCount(Team)) diff = otherTeam - GetInvitedCount(Team); // difference based on max players per team (don't allow inviting more) diff --git a/src/game/Battlegrounds/BattleGround.h b/src/game/Battlegrounds/BattleGround.h index 830701353..a4fa13518 100644 --- a/src/game/Battlegrounds/BattleGround.h +++ b/src/game/Battlegrounds/BattleGround.h @@ -389,8 +389,8 @@ class BattleGround /* Packet Transfer */ // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!) virtual void FillInitialWorldStates(WorldPacket& /*data*/, uint32& /*count*/) {} - void SendPacketToTeam(Team team, WorldPacket *packet, Player *sender = nullptr, bool self = true); - void SendPacketToAll(WorldPacket *packet); + void SendPacketToTeam(Team team, WorldPacket* packet, Player* sender = nullptr, bool self = true); + void SendPacketToAll(WorldPacket* packet); template void BroadcastWorker(Do& _do); diff --git a/src/game/Battlegrounds/BattleGroundAV.cpp b/src/game/Battlegrounds/BattleGroundAV.cpp index d05ade41b..1895127ea 100644 --- a/src/game/Battlegrounds/BattleGroundAV.cpp +++ b/src/game/Battlegrounds/BattleGroundAV.cpp @@ -448,12 +448,12 @@ void BattleGroundAV::UpgradeArmor(Object* questGiver, Player *player) setReinforcementLevelGroundUnit(teamIdx, ressources); - if(ressources%500 == 0 && m_Team_QuestStatus[teamIdx][0] != 0 && questGiver->GetTypeId() == TYPEID_UNIT) + if (ressources%500 == 0 && m_Team_QuestStatus[teamIdx][0] != 0 && questGiver->GetTypeId() == TYPEID_UNIT) { sprintf(sMessageRemaining,"Thanks for the supplies, %s",player->GetName()); ((Creature*)questGiver)->MonsterSay(sMessageRemaining, 0, 0); - if(ressources == 500) + if (ressources == 500) { if (teamIdx == 0) CastSpellOnTeam(28418, ALLIANCE); @@ -463,7 +463,7 @@ void BattleGroundAV::UpgradeArmor(Object* questGiver, Player *player) sprintf(sMessageRemaining,"Seasoned units are entering the battle!"); ((Creature*)questGiver)->MonsterYell(sMessageRemaining, 0, 0); } - else if(ressources == 1000) + else if (ressources == 1000) { if (teamIdx == 0) CastSpellOnTeam(28419, ALLIANCE); @@ -473,7 +473,7 @@ void BattleGroundAV::UpgradeArmor(Object* questGiver, Player *player) sprintf(sMessageRemaining,"Veteran units are entering the battle!"); ((Creature*)questGiver)->MonsterYell(sMessageRemaining, 0, 0); } - else if(ressources == 1500) + else if (ressources == 1500) { if (teamIdx == 0) CastSpellOnTeam(28420, ALLIANCE); @@ -516,15 +516,15 @@ void BattleGroundAV::HandleQuestComplete(Unit* questGiver, uint32 questid, Playe /** Update reinforcement infos */ // setReinforcementLevelGroundUnit(teamIdx, m_Team_QuestStatus[teamIdx][0]); - if((m_Team_QuestStatus[teamIdx][0]%100) == 0 && (m_Team_QuestStatus[teamIdx][0]%500) != 0&& questGiver->GetTypeId() == TYPEID_UNIT) + if ((m_Team_QuestStatus[teamIdx][0]%100) == 0 && (m_Team_QuestStatus[teamIdx][0]%500) != 0&& questGiver->GetTypeId() == TYPEID_UNIT) ((Creature*)questGiver)->MonsterSay("Great! Let's keep those supplies coming, people!", 0, 0); -/* if(m_Team_QuestStatus[teamIdx][0]%500 == 0 && m_Team_QuestStatus[teamIdx][0] != 0 && questGiver->GetTypeId() == TYPEID_UNIT) +/* if (m_Team_QuestStatus[teamIdx][0]%500 == 0 && m_Team_QuestStatus[teamIdx][0] != 0 && questGiver->GetTypeId() == TYPEID_UNIT) { sprintf(sMessageRemaining,"Thanks for the supplies, %s",player->GetName()); ((Creature*)questGiver)->MonsterSay(sMessageRemaining, 0, 0); - if(m_Team_QuestStatus[teamIdx][0] == 500) + if (m_Team_QuestStatus[teamIdx][0] == 500) { if (teamIdx == 0) CastSpellOnTeam(28418, ALLIANCE); @@ -534,7 +534,7 @@ void BattleGroundAV::HandleQuestComplete(Unit* questGiver, uint32 questid, Playe sprintf(sMessageRemaining,"Seasoned units are entering the battle!"); ((Creature*)questGiver)->MonsterYell(sMessageRemaining, 0, 0); } - else if(m_Team_QuestStatus[teamIdx][0] == 1000) + else if (m_Team_QuestStatus[teamIdx][0] == 1000) { if (teamIdx == 0) CastSpellOnTeam(28419, ALLIANCE); @@ -544,7 +544,7 @@ void BattleGroundAV::HandleQuestComplete(Unit* questGiver, uint32 questid, Playe sprintf(sMessageRemaining,"Veteran units are entering the battle!"); ((Creature*)questGiver)->MonsterYell(sMessageRemaining, 0, 0); } - else if(m_Team_QuestStatus[teamIdx][0] == 1500) + else if (m_Team_QuestStatus[teamIdx][0] == 1500) { if (teamIdx == 0) CastSpellOnTeam(28420, ALLIANCE); @@ -558,23 +558,23 @@ void BattleGroundAV::HandleQuestComplete(Unit* questGiver, uint32 questid, Playe } */ /** Adding visual crates each time 100 ressources are added */ - if((m_Team_QuestStatus[teamIdx][0]%500) == 100) + if ((m_Team_QuestStatus[teamIdx][0]%500) == 100) { SpawnEvent(AV_100_SUPPLIES+teamIdx, 0, true, false); } - else if((m_Team_QuestStatus[teamIdx][0]%500) == 200) + else if ((m_Team_QuestStatus[teamIdx][0]%500) == 200) { SpawnEvent(AV_200_SUPPLIES+teamIdx, 0, true, false); } - else if((m_Team_QuestStatus[teamIdx][0]%500) == 300) + else if ((m_Team_QuestStatus[teamIdx][0]%500) == 300) { SpawnEvent(AV_300_SUPPLIES+teamIdx, 0, true, true); } - else if((m_Team_QuestStatus[teamIdx][0]%500) == 400) + else if ((m_Team_QuestStatus[teamIdx][0]%500) == 400) { SpawnEvent(AV_400_SUPPLIES+teamIdx, 0, true, true); } - else if((m_Team_QuestStatus[teamIdx][0]%500) == 0 && m_Team_QuestStatus[teamIdx][0] !=0 ) + else if ((m_Team_QuestStatus[teamIdx][0]%500) == 0 && m_Team_QuestStatus[teamIdx][0] !=0) { SpawnEvent(AV_100_SUPPLIES+teamIdx, 2, true, false); SpawnEvent(AV_200_SUPPLIES+teamIdx, 2, true, false); @@ -699,26 +699,26 @@ void BattleGroundAV::HandleQuestComplete(Unit* questGiver, uint32 questid, Playe m_Team_QuestStatus[teamIdx][8]++; reputation = 1; - if (m_Team_QuestStatus[teamIdx][8]%25 == 0 && m_Team_QuestStatus[teamIdx][8] !=0 ) + if (m_Team_QuestStatus[teamIdx][8]%25 == 0 && m_Team_QuestStatus[teamIdx][8] !=0) questGiver->MonsterYell("The stables are filled up!", 0, 0); if ((m_Team_QuestStatus[teamIdx][8]%5) == 0) questGiver->PMonsterSay("Thanks for the supplies, %s",player->GetName()); /** Adding visual mount each time 5 ressources are added */ - if((m_Team_QuestStatus[teamIdx][8]%25) == 5) + if ((m_Team_QuestStatus[teamIdx][8]%25) == 5) { SpawnEvent(AV_05_TAMED+teamIdx, 0, true, false); } - else if((m_Team_QuestStatus[teamIdx][8]%25) == 10) + else if ((m_Team_QuestStatus[teamIdx][8]%25) == 10) { SpawnEvent(AV_10_TAMED+teamIdx, 0, true, false); } - else if((m_Team_QuestStatus[teamIdx][8]%25) == 15) + else if ((m_Team_QuestStatus[teamIdx][8]%25) == 15) { SpawnEvent(AV_15_TAMED+teamIdx, 0, true, true); } - else if((m_Team_QuestStatus[teamIdx][8]%25) == 20) + else if ((m_Team_QuestStatus[teamIdx][8]%25) == 20) { SpawnEvent(AV_20_TAMED+teamIdx, 0, true, true); } diff --git a/src/game/Battlegrounds/BattleGroundMgr.cpp b/src/game/Battlegrounds/BattleGroundMgr.cpp index d9ab50363..44ae188e5 100644 --- a/src/game/Battlegrounds/BattleGroundMgr.cpp +++ b/src/game/Battlegrounds/BattleGroundMgr.cpp @@ -975,7 +975,7 @@ void BattleGroundMgr::Update(uint32 diff) } } -void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGround *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2) +void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket* data, BattleGround *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2) { // we can be in 3 queues in same time... if (StatusID == 0 || !bg) @@ -1016,7 +1016,7 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro } } -void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg) +void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround *bg) { data->Initialize(MSG_PVP_LOG_DATA, (1 + 4 + 40 * bg->GetPlayerScoresSize())); @@ -1081,33 +1081,33 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg) } } -void BattleGroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket *data, int32 status) +void BattleGroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket* data, int32 status) { data->Initialize(SMSG_GROUP_JOINED_BATTLEGROUND, 4); // for status, see enum BattleGroundGroupJoinStatus *data << int32(status); } -void BattleGroundMgr::BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value) +void BattleGroundMgr::BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value) { data->Initialize(SMSG_UPDATE_WORLD_STATE, 4 + 4); *data << uint32(field); *data << uint32(value); } -void BattleGroundMgr::BuildPlaySoundPacket(WorldPacket *data, uint32 soundid) +void BattleGroundMgr::BuildPlaySoundPacket(WorldPacket* data, uint32 soundid) { data->Initialize(SMSG_PLAY_SOUND, 4); *data << uint32(soundid); } -void BattleGroundMgr::BuildPlayerLeftBattleGroundPacket(WorldPacket *data, ObjectGuid guid) +void BattleGroundMgr::BuildPlayerLeftBattleGroundPacket(WorldPacket* data, ObjectGuid guid) { data->Initialize(SMSG_BATTLEGROUND_PLAYER_LEFT, 8); *data << ObjectGuid(guid); } -void BattleGroundMgr::BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr) +void BattleGroundMgr::BuildPlayerJoinedBattleGroundPacket(WorldPacket* data, Player* plr) { data->Initialize(SMSG_BATTLEGROUND_PLAYER_JOINED, 8); *data << plr->GetObjectGuid(); @@ -1352,7 +1352,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds() sLog.outString(">> Loaded %u battlegrounds", count); } -void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, ObjectGuid guid, Player* plr, BattleGroundTypeId bgTypeId) +void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket* data, ObjectGuid guid, Player* plr, BattleGroundTypeId bgTypeId) { if (!plr) return; diff --git a/src/game/Battlegrounds/BattleGroundMgr.h b/src/game/Battlegrounds/BattleGroundMgr.h index 6ef8b2baf..bdff0c29d 100644 --- a/src/game/Battlegrounds/BattleGroundMgr.h +++ b/src/game/Battlegrounds/BattleGroundMgr.h @@ -200,14 +200,14 @@ class BattleGroundMgr void Update(uint32 diff); /* Packet Building */ - void BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr); - void BuildPlayerLeftBattleGroundPacket(WorldPacket *data, ObjectGuid guid); - void BuildBattleGroundListPacket(WorldPacket *data, ObjectGuid guid, Player *plr, BattleGroundTypeId bgTypeId); - void BuildGroupJoinedBattlegroundPacket(WorldPacket *data, int32 status); - void BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value); - void BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg); - void BuildBattleGroundStatusPacket(WorldPacket *data, BattleGround *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2); - void BuildPlaySoundPacket(WorldPacket *data, uint32 soundid); + void BuildPlayerJoinedBattleGroundPacket(WorldPacket* data, Player* plr); + void BuildPlayerLeftBattleGroundPacket(WorldPacket* data, ObjectGuid guid); + void BuildBattleGroundListPacket(WorldPacket* data, ObjectGuid guid, Player* plr, BattleGroundTypeId bgTypeId); + void BuildGroupJoinedBattlegroundPacket(WorldPacket* data, int32 status); + void BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value); + void BuildPvpLogDataPacket(WorldPacket* data, BattleGround *bg); + void BuildBattleGroundStatusPacket(WorldPacket* data, BattleGround* bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2); + void BuildPlaySoundPacket(WorldPacket* data, uint32 soundid); /* Battlegrounds */ BattleGroundSet::iterator GetBattleGroundsBegin(BattleGroundTypeId bgTypeId) { return m_BattleGrounds[bgTypeId].begin(); }; @@ -258,14 +258,14 @@ class BattleGroundMgr const BattleGroundEventIdx GetCreatureEventIndex(uint32 dbTableGuidLow) const { CreatureBattleEventIndexesMap::const_iterator itr = m_CreatureBattleEventIndexMap.find(dbTableGuidLow); - if(itr != m_CreatureBattleEventIndexMap.end()) + if (itr != m_CreatureBattleEventIndexMap.end()) return itr->second[0]; return m_CreatureBattleEventIndexMap.find(-1)->second[0]; } const BattleGroundEventIdx GetGameObjectEventIndex(uint32 dbTableGuidLow) const { GameObjectBattleEventIndexesMap::const_iterator itr = m_GameObjectBattleEventIndexMap.find(dbTableGuidLow); - if(itr != m_GameObjectBattleEventIndexMap.end()) + if (itr != m_GameObjectBattleEventIndexMap.end()) return itr->second[0]; return m_GameObjectBattleEventIndexMap.find(-1)->second[0]; } @@ -273,14 +273,14 @@ class BattleGroundMgr std::vector const& GetCreatureEventsVector(uint32 dbTableGuidLow) const { CreatureBattleEventIndexesMap::const_iterator itr = m_CreatureBattleEventIndexMap.find(dbTableGuidLow); - if(itr != m_CreatureBattleEventIndexMap.end()) + if (itr != m_CreatureBattleEventIndexMap.end()) return itr->second; return m_CreatureBattleEventIndexMap.find(-1)->second; } std::vector const& GetGameObjectEventsVector(uint32 dbTableGuidLow) const { GameObjectBattleEventIndexesMap::const_iterator itr = m_GameObjectBattleEventIndexMap.find(dbTableGuidLow); - if(itr != m_GameObjectBattleEventIndexMap.end()) + if (itr != m_GameObjectBattleEventIndexMap.end()) return itr->second; return m_GameObjectBattleEventIndexMap.find(-1)->second; } diff --git a/src/game/Camera.cpp b/src/game/Camera.cpp index f5cc71541..74685c88e 100644 --- a/src/game/Camera.cpp +++ b/src/game/Camera.cpp @@ -40,7 +40,7 @@ Camera::~Camera() m_source->GetViewPoint().Detach(this); } -void Camera::ReceivePacket(WorldPacket *data) +void Camera::ReceivePacket(WorldPacket* data) { m_owner.SendDirectMessage(data); } diff --git a/src/game/Camera.h b/src/game/Camera.h index dca67209a..4eac0d30d 100644 --- a/src/game/Camera.h +++ b/src/game/Camera.h @@ -52,10 +52,10 @@ class MANGOS_DLL_SPEC Camera void ResetView(bool update_far_sight_field = true); template - void UpdateVisibilityOf(T * obj, UpdateData &d, std::set& vis); + void UpdateVisibilityOf(T* obj, UpdateData &d, std::set& vis); void UpdateVisibilityOf(WorldObject* obj); - void ReceivePacket(WorldPacket *data); + void ReceivePacket(WorldPacket* data); // updates visibility of worldobjects around viewpoint for camera's owner void UpdateVisibilityForOwner(); diff --git a/src/game/Chat/Channel.cpp b/src/game/Chat/Channel.cpp index 4e48966e9..6439a48ee 100644 --- a/src/game/Chat/Channel.cpp +++ b/src/game/Chat/Channel.cpp @@ -774,7 +774,7 @@ void Channel::SetOwner(ObjectGuid guid, bool exclaim) } } -void Channel::SendToAll(WorldPacket *data, ObjectGuid guid) +void Channel::SendToAll(WorldPacket* data, ObjectGuid guid) { for (PlayerList::const_iterator i = m_players.begin(); i != m_players.end(); ++i) { @@ -784,7 +784,7 @@ void Channel::SendToAll(WorldPacket *data, ObjectGuid guid) } } -void Channel::SendToOne(WorldPacket *data, ObjectGuid who) +void Channel::SendToOne(WorldPacket* data, ObjectGuid who) { PlayerPointer pPlayer = GetPlayer(who); if (pPlayer) @@ -801,26 +801,26 @@ void Channel::DeVoice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/) } -void Channel::MakeNotifyPacket(WorldPacket *data, uint8 notify_type) +void Channel::MakeNotifyPacket(WorldPacket* data, uint8 notify_type) { data->Initialize(SMSG_CHANNEL_NOTIFY, 1 + m_name.size() + 1); *data << uint8(notify_type); *data << m_name; } -void Channel::MakeJoined(WorldPacket *data, ObjectGuid guid) +void Channel::MakeJoined(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_JOINED_NOTICE); *data << ObjectGuid(guid); } -void Channel::MakeLeft(WorldPacket *data, ObjectGuid guid) +void Channel::MakeLeft(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_LEFT_NOTICE); *data << ObjectGuid(guid); } -void Channel::MakeYouJoined(WorldPacket *data) +void Channel::MakeYouJoined(WorldPacket* data) { MakeNotifyPacket(data, CHAT_YOU_JOINED_NOTICE); *data << uint32(GetFlags()); @@ -828,19 +828,19 @@ void Channel::MakeYouJoined(WorldPacket *data) *data << uint8(0); // CString max length 512, conditional read } -void Channel::MakeYouLeft(WorldPacket *data) +void Channel::MakeYouLeft(WorldPacket* data) { MakeNotifyPacket(data, CHAT_YOU_LEFT_NOTICE); //*data << uint32(GetChannelId()); //[-ZERO] //*data << uint8(0); //[-ZERO] can be 0x00 and 0x01 (bool) } -void Channel::MakeWrongPassword(WorldPacket *data) +void Channel::MakeWrongPassword(WorldPacket* data) { MakeNotifyPacket(data, CHAT_WRONG_PASSWORD_NOTICE); } -void Channel::MakeNotMember(WorldPacket *data) +void Channel::MakeNotMember(WorldPacket* data) { MakeNotifyPacket(data, CHAT_NOT_MEMBER_NOTICE); } @@ -851,35 +851,35 @@ void Channel::MakeNotOnPacket(WorldPacket* data, const std::string &name) (*data) << (uint8)CHAT_NOT_MEMBER_NOTICE << name; } -void Channel::MakeNotModerator(WorldPacket *data) +void Channel::MakeNotModerator(WorldPacket* data) { MakeNotifyPacket(data, CHAT_NOT_MODERATOR_NOTICE); } -void Channel::MakePasswordChanged(WorldPacket *data, ObjectGuid guid) +void Channel::MakePasswordChanged(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_PASSWORD_CHANGED_NOTICE); *data << ObjectGuid(guid); } -void Channel::MakeOwnerChanged(WorldPacket *data, ObjectGuid guid) +void Channel::MakeOwnerChanged(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_OWNER_CHANGED_NOTICE); *data << ObjectGuid(guid); } -void Channel::MakePlayerNotFound(WorldPacket *data, std::string const& name) +void Channel::MakePlayerNotFound(WorldPacket* data, std::string const& name) { MakeNotifyPacket(data, CHAT_PLAYER_NOT_FOUND_NOTICE); *data << name; } -void Channel::MakeNotOwner(WorldPacket *data) +void Channel::MakeNotOwner(WorldPacket* data) { MakeNotifyPacket(data, CHAT_NOT_OWNER_NOTICE); } -void Channel::MakeChannelOwner(WorldPacket *data) +void Channel::MakeChannelOwner(WorldPacket* data) { std::string name; @@ -890,7 +890,7 @@ void Channel::MakeChannelOwner(WorldPacket *data) *data << ((IsConstant() || !m_ownerGuid) ? "Nobody" : name); } -void Channel::MakeModeChange(WorldPacket *data, ObjectGuid guid, uint8 oldflags) +void Channel::MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags) { MakeNotifyPacket(data, CHAT_MODE_CHANGE_NOTICE); *data << ObjectGuid(guid); @@ -898,112 +898,112 @@ void Channel::MakeModeChange(WorldPacket *data, ObjectGuid guid, uint8 oldflags) *data << uint8(GetPlayerFlags(guid)); } -void Channel::MakeAnnouncementsOn(WorldPacket *data, ObjectGuid guid) +void Channel::MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_ON_NOTICE); *data << ObjectGuid(guid); } -void Channel::MakeAnnouncementsOff(WorldPacket *data, ObjectGuid guid) +void Channel::MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_OFF_NOTICE); *data << ObjectGuid(guid); } -void Channel::MakeModerationOn(WorldPacket *data, ObjectGuid guid) +void Channel::MakeModerationOn(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_MODERATION_ON_NOTICE); *data << ObjectGuid(guid); } -void Channel::MakeModerationOff(WorldPacket *data, ObjectGuid guid) +void Channel::MakeModerationOff(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_MODERATION_OFF_NOTICE); *data << ObjectGuid(guid); } -void Channel::MakeMuted(WorldPacket *data) +void Channel::MakeMuted(WorldPacket* data) { MakeNotifyPacket(data, CHAT_MUTED_NOTICE); } -void Channel::MakePlayerKicked(WorldPacket *data, ObjectGuid target, ObjectGuid source) +void Channel::MakePlayerKicked(WorldPacket* data, ObjectGuid target, ObjectGuid source) { MakeNotifyPacket(data, CHAT_PLAYER_KICKED_NOTICE); *data << ObjectGuid(target); *data << ObjectGuid(source); } -void Channel::MakeBanned(WorldPacket *data) +void Channel::MakeBanned(WorldPacket* data) { MakeNotifyPacket(data, CHAT_BANNED_NOTICE); } -void Channel::MakePlayerBanned(WorldPacket *data, ObjectGuid target, ObjectGuid source) +void Channel::MakePlayerBanned(WorldPacket* data, ObjectGuid target, ObjectGuid source) { MakeNotifyPacket(data, CHAT_PLAYER_BANNED_NOTICE); *data << ObjectGuid(target); *data << ObjectGuid(source); } -void Channel::MakePlayerUnbanned(WorldPacket *data, ObjectGuid target, ObjectGuid source) +void Channel::MakePlayerUnbanned(WorldPacket* data, ObjectGuid target, ObjectGuid source) { MakeNotifyPacket(data, CHAT_PLAYER_UNBANNED_NOTICE); *data << ObjectGuid(target); *data << ObjectGuid(source); } -void Channel::MakePlayerNotBanned(WorldPacket *data, std::string const& name) +void Channel::MakePlayerNotBanned(WorldPacket* data, std::string const& name) { MakeNotifyPacket(data, CHAT_PLAYER_NOT_BANNED_NOTICE); *data << name; } -void Channel::MakePlayerAlreadyMember(WorldPacket *data, ObjectGuid guid) +void Channel::MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_PLAYER_ALREADY_MEMBER_NOTICE); *data << ObjectGuid(guid); } -void Channel::MakeInvite(WorldPacket *data, ObjectGuid guid) +void Channel::MakeInvite(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_INVITE_NOTICE); *data << ObjectGuid(guid); } -void Channel::MakeInviteWrongFaction(WorldPacket *data) +void Channel::MakeInviteWrongFaction(WorldPacket* data) { MakeNotifyPacket(data, CHAT_INVITE_WRONG_FACTION_NOTICE); } -void Channel::MakeWrongFaction(WorldPacket *data) +void Channel::MakeWrongFaction(WorldPacket* data) { MakeNotifyPacket(data, CHAT_WRONG_FACTION_NOTICE); } -void Channel::MakeInvalidName(WorldPacket *data) +void Channel::MakeInvalidName(WorldPacket* data) { MakeNotifyPacket(data, CHAT_INVALID_NAME_NOTICE); } -void Channel::MakeNotModerated(WorldPacket *data) +void Channel::MakeNotModerated(WorldPacket* data) { MakeNotifyPacket(data, CHAT_NOT_MODERATED_NOTICE); } -void Channel::MakePlayerInvited(WorldPacket *data, std::string const& name) +void Channel::MakePlayerInvited(WorldPacket* data, std::string const& name) { MakeNotifyPacket(data, CHAT_PLAYER_INVITED_NOTICE); *data << name; } -void Channel::MakePlayerInviteBanned(WorldPacket *data, std::string const& name) +void Channel::MakePlayerInviteBanned(WorldPacket* data, std::string const& name) { MakeNotifyPacket(data, CHAT_PLAYER_INVITE_BANNED_NOTICE); *data << name; } -void Channel::MakeThrottled(WorldPacket *data) +void Channel::MakeThrottled(WorldPacket* data) { MakeNotifyPacket(data, CHAT_THROTTLED_NOTICE); } diff --git a/src/game/Chat/Channel.h b/src/game/Chat/Channel.h index e9ecd88d6..f38389d7e 100644 --- a/src/game/Chat/Channel.h +++ b/src/game/Chat/Channel.h @@ -135,23 +135,23 @@ class Channel uint8 flags; bool HasFlag(uint8 flag) { return flags & flag; } - void SetFlag(uint8 flag) { if(!HasFlag(flag)) flags |= flag; } + void SetFlag(uint8 flag) { if (!HasFlag(flag)) flags |= flag; } bool IsOwner() { return flags & MEMBER_FLAG_OWNER; } void SetOwner(bool state) { - if(state) flags |= MEMBER_FLAG_OWNER; + if (state) flags |= MEMBER_FLAG_OWNER; else flags &= ~MEMBER_FLAG_OWNER; } bool IsModerator() { return flags & MEMBER_FLAG_MODERATOR; } void SetModerator(bool state) { - if(state) flags |= MEMBER_FLAG_MODERATOR; + if (state) flags |= MEMBER_FLAG_MODERATOR; else flags &= ~MEMBER_FLAG_MODERATOR; } bool IsMuted() { return flags & MEMBER_FLAG_MUTED; } void SetMuted(bool state) { - if(state) flags |= MEMBER_FLAG_MUTED; + if (state) flags |= MEMBER_FLAG_MUTED; else flags &= ~MEMBER_FLAG_MUTED; } }; @@ -204,43 +204,43 @@ class Channel static void MakeNotOnPacket(WorldPacket* data, const std::string &name); private: // initial packet data (notify type and channel name) - void MakeNotifyPacket(WorldPacket *data, uint8 notify_type); + void MakeNotifyPacket(WorldPacket* data, uint8 notify_type); // type specific packet data - void MakeJoined(WorldPacket *data, ObjectGuid guid); //+ 0x00 - void MakeLeft(WorldPacket *data, ObjectGuid guid); //+ 0x01 - void MakeYouJoined(WorldPacket *data); //+ 0x02 - void MakeYouLeft(WorldPacket *data); //+ 0x03 - void MakeWrongPassword(WorldPacket *data); //? 0x04 - void MakeNotMember(WorldPacket *data); //? 0x05 - void MakeNotModerator(WorldPacket *data); //? 0x06 - void MakePasswordChanged(WorldPacket *data, ObjectGuid guid); //+ 0x07 - void MakeOwnerChanged(WorldPacket *data, ObjectGuid guid); //? 0x08 - void MakePlayerNotFound(WorldPacket *data, std::string const& name); //+ 0x09 - void MakeNotOwner(WorldPacket *data); //? 0x0A - void MakeChannelOwner(WorldPacket *data); //? 0x0B - void MakeModeChange(WorldPacket *data, ObjectGuid guid, uint8 oldflags);//+ 0x0C - void MakeAnnouncementsOn(WorldPacket *data, ObjectGuid guid); //+ 0x0D - void MakeAnnouncementsOff(WorldPacket *data, ObjectGuid guid); //+ 0x0E - void MakeModerationOn(WorldPacket *data, ObjectGuid guid); //+ 0x0F - void MakeModerationOff(WorldPacket *data, ObjectGuid guid); //+ 0x10 - void MakeMuted(WorldPacket *data); //? 0x11 - void MakePlayerKicked(WorldPacket *data, ObjectGuid target, ObjectGuid source);//? 0x12 - void MakeBanned(WorldPacket *data); //? 0x13 - void MakePlayerBanned(WorldPacket *data, ObjectGuid target, ObjectGuid source);//? 0x14 - void MakePlayerUnbanned(WorldPacket *data, ObjectGuid target, ObjectGuid source);//? 0x15 - void MakePlayerNotBanned(WorldPacket *data, std::string const& name); //? 0x16 - void MakePlayerAlreadyMember(WorldPacket *data, ObjectGuid guid); //+ 0x17 - void MakeInvite(WorldPacket *data, ObjectGuid guid); //? 0x18 - void MakeInviteWrongFaction(WorldPacket *data); //? 0x19 - void MakeWrongFaction(WorldPacket *data); //? 0x1A - void MakeInvalidName(WorldPacket *data); //? 0x1B - void MakeNotModerated(WorldPacket *data); //? 0x1C - void MakePlayerInvited(WorldPacket *data, std::string const& name); //+ 0x1D - void MakePlayerInviteBanned(WorldPacket *data, std::string const& name);//? 0x1E - void MakeThrottled(WorldPacket *data); //? 0x1F + void MakeJoined(WorldPacket* data, ObjectGuid guid); //+ 0x00 + void MakeLeft(WorldPacket* data, ObjectGuid guid); //+ 0x01 + void MakeYouJoined(WorldPacket* data); //+ 0x02 + void MakeYouLeft(WorldPacket* data); //+ 0x03 + void MakeWrongPassword(WorldPacket* data); //? 0x04 + void MakeNotMember(WorldPacket* data); //? 0x05 + void MakeNotModerator(WorldPacket* data); //? 0x06 + void MakePasswordChanged(WorldPacket* data, ObjectGuid guid); //+ 0x07 + void MakeOwnerChanged(WorldPacket* data, ObjectGuid guid); //? 0x08 + void MakePlayerNotFound(WorldPacket* data, std::string const& name); //+ 0x09 + void MakeNotOwner(WorldPacket* data); //? 0x0A + void MakeChannelOwner(WorldPacket* data); //? 0x0B + void MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags);//+ 0x0C + void MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid); //+ 0x0D + void MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid); //+ 0x0E + void MakeModerationOn(WorldPacket* data, ObjectGuid guid); //+ 0x0F + void MakeModerationOff(WorldPacket* data, ObjectGuid guid); //+ 0x10 + void MakeMuted(WorldPacket* data); //? 0x11 + void MakePlayerKicked(WorldPacket* data, ObjectGuid target, ObjectGuid source);//? 0x12 + void MakeBanned(WorldPacket* data); //? 0x13 + void MakePlayerBanned(WorldPacket* data, ObjectGuid target, ObjectGuid source);//? 0x14 + void MakePlayerUnbanned(WorldPacket* data, ObjectGuid target, ObjectGuid source);//? 0x15 + void MakePlayerNotBanned(WorldPacket* data, std::string const& name); //? 0x16 + void MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid); //+ 0x17 + void MakeInvite(WorldPacket* data, ObjectGuid guid); //? 0x18 + void MakeInviteWrongFaction(WorldPacket* data); //? 0x19 + void MakeWrongFaction(WorldPacket* data); //? 0x1A + void MakeInvalidName(WorldPacket* data); //? 0x1B + void MakeNotModerated(WorldPacket* data); //? 0x1C + void MakePlayerInvited(WorldPacket* data, std::string const& name); //+ 0x1D + void MakePlayerInviteBanned(WorldPacket* data, std::string const& name);//? 0x1E + void MakeThrottled(WorldPacket* data); //? 0x1F - void SendToAll(WorldPacket *data, ObjectGuid guid = ObjectGuid()); - void SendToOne(WorldPacket *data, ObjectGuid who); + void SendToAll(WorldPacket* data, ObjectGuid guid = ObjectGuid()); + void SendToOne(WorldPacket* data, ObjectGuid who); bool IsOn(ObjectGuid who) const { return m_players.find(who) != m_players.end(); } bool IsBanned(ObjectGuid guid) const { return m_banned.find(guid) != m_banned.end(); } diff --git a/src/game/Chat/Chat.h b/src/game/Chat/Chat.h index aeda2c80b..975b0a443 100644 --- a/src/game/Chat/Chat.h +++ b/src/game/Chat/Chat.h @@ -182,12 +182,12 @@ class MANGOS_DLL_SPEC ChatHandler void FillFullCommandsName(ChatCommand* table, std::string prefix); ChatCommand* getCommandTable(); - bool HandleAnticheatCommand(char *); - bool HandleClientInfosCommand(char* ); - bool HandleClientSearchCommand(char* ); + bool HandleAnticheatCommand(char*); + bool HandleClientInfosCommand(char*); + bool HandleClientSearchCommand(char*); bool HandleReloadAnticheatCommand(char*); - bool HandleRunTestCommand(char* ); - bool HandleViewLogCommand(char* ); + bool HandleRunTestCommand(char*); + bool HandleViewLogCommand(char*); //Cheats bool HandleCheatStatusCommand(char *); @@ -213,8 +213,8 @@ class MANGOS_DLL_SPEC ChatHandler bool HandleDebugTimeCommand(char *); bool HandleDebugMoveFlagsCommand(char *); bool HandleDebugMoveSplineCommand(char *); - bool HandleDebugExp(char* ); - bool HandleVideoTurn(char* ); + bool HandleDebugExp(char*); + bool HandleVideoTurn(char*); bool HandleDebugLootTableCommand(char*); bool HandleDebugItemEnchantCommand(int lootid, unsigned int simCount); bool HandleServiceDeleteCharacters(char* args); @@ -369,8 +369,8 @@ class MANGOS_DLL_SPEC ChatHandler bool HandleReloadInstanceBuffRemoval(char* args); bool HandleReloadPetitions(char* args); // Channel - bool HandleChannelJoinCommand(char* ); - bool HandleChannelLeaveCommand(char* ); + bool HandleChannelJoinCommand(char*); + bool HandleChannelLeaveCommand(char*); bool HandleAccountCommand(char* args); bool HandleAccountCharactersCommand(char* args); @@ -953,7 +953,7 @@ class MANGOS_DLL_SPEC ChatHandler // Utility methods for commands bool ShowAccountIpListHelper(char* args, bool onlineonly); - void ShowFactionListHelper(FactionEntry const * factionEntry, LocaleConstant loc, FactionState const* repState = nullptr, Player * target = nullptr ); + void ShowFactionListHelper(FactionEntry const* factionEntry, LocaleConstant loc, FactionState const* repState = nullptr, Player * target = nullptr); void ShowItemListHelper(uint32 itemId, int loc_idx, Player* target = nullptr); void ShowQuestListHelper(uint32 questId, int32 loc_idx, Player* target = nullptr); void ShowSpellListHelper(Player* target, SpellEntry const* spellInfo, LocaleConstant loc); diff --git a/src/game/Commands/AccountCommands.cpp b/src/game/Commands/AccountCommands.cpp index 6bedcf716..ac89899d4 100644 --- a/src/game/Commands/AccountCommands.cpp +++ b/src/game/Commands/AccountCommands.cpp @@ -234,7 +234,7 @@ bool ChatHandler::HandleAccountCreateCommand(char* args) ///- %Parse the command line arguments char *szAcc = ExtractQuotedOrLiteralArg(&args); char *szPassword = ExtractQuotedOrLiteralArg(&args); - if(!szAcc || !szPassword) + if (!szAcc || !szPassword) return false; // normalized in accmgr.CreateAccount diff --git a/src/game/Commands/CharacterCommands.cpp b/src/game/Commands/CharacterCommands.cpp index 13a05f203..7f0b638c1 100644 --- a/src/game/Commands/CharacterCommands.cpp +++ b/src/game/Commands/CharacterCommands.cpp @@ -67,7 +67,7 @@ bool ChatHandler::HandleXpCommand(char* args) } pPlayer->SetPersonalXpRate(xp); - PSendSysMessage(LANG_XP_RATE_SET, (pPlayer != m_session->GetPlayer() ? (std::string(pPlayer->GetName()) + std::string("'s")).c_str() : "your" ), xp); + PSendSysMessage(LANG_XP_RATE_SET, (pPlayer != m_session->GetPlayer() ? (std::string(pPlayer->GetName()) + std::string("'s")).c_str() : "your"), xp); return true; } @@ -1260,7 +1260,7 @@ std::string ChatHandler::GenerateDeletedCharacterGUIDsWhereStr(DeletedInfoList:: } DeletedInfoList::const_iterator itr2 = itr; - if(++itr2 != itr_end) + if (++itr2 != itr_end) wherestr << "','"; } wherestr << "')"; @@ -1659,7 +1659,7 @@ void ChatHandler::HandleCharacterLevel(Player* player, ObjectGuid player_guid, u ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, GetNameLink().c_str()); else if (oldlevel < newlevel) ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_UP, GetNameLink().c_str(), newlevel); - else // if(oldlevel > newlevel) + else // if (oldlevel > newlevel) ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, GetNameLink().c_str(), newlevel); } } @@ -1771,7 +1771,7 @@ bool ChatHandler::HandleCharacterReputationCommand(char* args) bool ChatHandler::HandleCharacterHasItemCommand(char* args) { - if(!*args) + if (!*args) return false; uint32 itemId = 0; @@ -3722,7 +3722,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player) //-1 is default value player->SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, -1); - //player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000 ); + //player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000); return true; } diff --git a/src/game/Commands/TeleportCommands.cpp b/src/game/Commands/TeleportCommands.cpp index 337b2d5c6..c1303446f 100644 --- a/src/game/Commands/TeleportCommands.cpp +++ b/src/game/Commands/TeleportCommands.cpp @@ -1246,7 +1246,7 @@ bool ChatHandler::HandleGonameCommand(char* args) } // all's well, set bg id // when porting out from the bg, it will be reset to 0 - if(pPlayer->GetBattleGroundId() != pTarget->GetBattleGroundId()) + if (pPlayer->GetBattleGroundId() != pTarget->GetBattleGroundId()) { pPlayer->SetBattleGroundId(pTarget->GetBattleGroundId(), pTarget->GetBattleGroundTypeId()); teleFlags |= TELE_TO_FORCE_MAP_CHANGE; diff --git a/src/game/Database/DBCStores.cpp b/src/game/Database/DBCStores.cpp index fbefc1be2..c36ac6916 100644 --- a/src/game/Database/DBCStores.cpp +++ b/src/game/Database/DBCStores.cpp @@ -537,19 +537,19 @@ ChatChannelsEntry const* GetChannelEntryFor(std::string const& name) /*[-ZERO] bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId) { - if(requiredTotemCategoryId==0) + if (requiredTotemCategoryId==0) return true; - if(itemTotemCategoryId==0) + if (itemTotemCategoryId==0) return false; TotemCategoryEntry const* itemEntry = sTotemCategoryStore.LookupEntry(itemTotemCategoryId); - if(!itemEntry) + if (!itemEntry) return false; TotemCategoryEntry const* reqEntry = sTotemCategoryStore.LookupEntry(requiredTotemCategoryId); - if(!reqEntry) + if (!reqEntry) return false; - if(itemEntry->categoryType!=reqEntry->categoryType) + if (itemEntry->categoryType!=reqEntry->categoryType) return false; return (itemEntry->categoryMask & reqEntry->categoryMask)==reqEntry->categoryMask; diff --git a/src/game/Database/DBCStructure.h b/src/game/Database/DBCStructure.h index af8bb425c..9f7b4bd9c 100644 --- a/src/game/Database/DBCStructure.h +++ b/src/game/Database/DBCStructure.h @@ -36,7 +36,7 @@ // Structures using to access raw DBC data and required packing to portability // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack(1) #else #pragma pack(push,1) @@ -315,7 +315,7 @@ struct FactionTemplateEntry // helpers bool IsFriendlyTo(FactionTemplateEntry const& entry) const { - if(entry.faction) + if (entry.faction) { for(int i = 0; i < 4; ++i) if (enemyFaction[i] == entry.faction) @@ -328,7 +328,7 @@ struct FactionTemplateEntry } bool IsHostileTo(FactionTemplateEntry const& entry) const { - if(entry.faction) + if (entry.faction) { for(int i = 0; i < 4; ++i) if (enemyFaction[i] == entry.faction) @@ -691,7 +691,7 @@ struct WorldSafeLocsEntry }; // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack() #else #pragma pack(pop) diff --git a/src/game/Formulas.h b/src/game/Formulas.h index f914d71c1..83a8b784f 100644 --- a/src/game/Formulas.h +++ b/src/game/Formulas.h @@ -158,20 +158,20 @@ namespace MaNGOS ((Creature*)pUnit)->GetCreatureInfo()->type != CREATURE_TYPE_TOTEM && ((Creature*)pUnit)->GetCreatureInfo()->health_min > 50; - if(pUnit->GetTypeId()==TYPEID_UNIT && ( + if (pUnit->GetTypeId()==TYPEID_UNIT && ( (pUnit->GetUInt32Value(UNIT_CREATED_BY_SPELL) && !isPet) || (((Creature*)pUnit)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) || pUnit->HasUnitState(UNIT_STAT_NO_KILL_REWARD))) return 0; uint32 xp_gain= BaseGain(pPet->GetLevel(), pUnit->GetLevel()); - if( xp_gain == 0 ) + if (xp_gain == 0) return 0; - if(pUnit->GetTypeId()==TYPEID_UNIT && ((Creature*)pUnit)->IsElite()) + if (pUnit->GetTypeId()==TYPEID_UNIT && ((Creature*)pUnit)->IsElite()) xp_gain *= 2; - if(isPet) + if (isPet) xp_gain *= 0.75f; float personalRate = -1.0f; @@ -189,7 +189,7 @@ namespace MaNGOS inline float xp_in_group_rate(uint32 count, bool isRaid) { - if(isRaid) + if (isRaid) { // FIX ME: must apply decrease modifiers dependent from raid size return 1.0f; diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index a3dec6765..5a23c9683 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -191,7 +191,7 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, ObjectGuid objectGuid) } GetMenuSession()->SendPacket(&data); - //DEBUG_LOG( "WORLD: Sent SMSG_GOSSIP_MESSAGE NPCGuid=%u",GUID_LOPART(npcGUID) ); + //DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_MESSAGE NPCGuid=%u",GUID_LOPART(npcGUID)); } void PlayerMenu::CloseGossip() @@ -199,7 +199,7 @@ void PlayerMenu::CloseGossip() WorldPacket data(SMSG_GOSSIP_COMPLETE, 0); GetMenuSession()->SendPacket(&data); - //DEBUG_LOG( "WORLD: Sent SMSG_GOSSIP_COMPLETE" ); + //DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_COMPLETE"); } // Outdated diff --git a/src/game/GossipDef.h b/src/game/GossipDef.h index 2e27a7381..940ce4c38 100644 --- a/src/game/GossipDef.h +++ b/src/game/GossipDef.h @@ -196,7 +196,7 @@ class MANGOS_DLL_SPEC GossipMenu return m_gItems.empty(); } - GossipMenuItem const& GetItem( unsigned int Id ) + GossipMenuItem const& GetItem(unsigned int Id) { return m_gItems[ Id ]; } @@ -206,9 +206,9 @@ class MANGOS_DLL_SPEC GossipMenu return m_gItemsData[indexId]; } - uint32 MenuItemSender( unsigned int ItemId ); - uint32 MenuItemAction( unsigned int ItemId ); - bool MenuItemCoded( unsigned int ItemId ); + uint32 MenuItemSender(unsigned int ItemId); + uint32 MenuItemAction(unsigned int ItemId); + bool MenuItemCoded(unsigned int ItemId); void ClearMenu(); @@ -231,7 +231,7 @@ class QuestMenu QuestMenu(); ~QuestMenu(); - void AddMenuItem( uint32 QuestId, uint8 Icon); + void AddMenuItem(uint32 QuestId, uint8 Icon); void ClearMenu(); uint8 MenuItemCount() const @@ -244,11 +244,11 @@ class QuestMenu return m_qItems.empty(); } - bool HasItem( uint32 questid ); + bool HasItem(uint32 questid); - QuestMenuItem const& GetItem( uint16 Id ) + QuestMenuItem const& GetItem(uint16 Id) { - return m_qItems[ Id ]; + return m_qItems[Id]; } protected: @@ -273,16 +273,16 @@ class MANGOS_DLL_SPEC PlayerMenu bool Empty() const { return mGossipMenu.Empty() && mQuestMenu.Empty(); } void ClearMenus(); - uint32 GossipOptionSender( unsigned int Selection ); - uint32 GossipOptionAction( unsigned int Selection ); - bool GossipOptionCoded( unsigned int Selection ); + uint32 GossipOptionSender(unsigned int Selection); + uint32 GossipOptionAction(unsigned int Selection); + bool GossipOptionCoded(unsigned int Selection); void SendGossipMenu(uint32 titleTextId, ObjectGuid objectGuid); void CloseGossip(); - void SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char * locName ); - void SendPointOfInterest( uint32 poi_id ); - void SendTalking( uint32 textID ); - void SendTalking( char const * title, char const * text ); + void SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char * locName); + void SendPointOfInterest(uint32 poi_id); + void SendTalking(uint32 textID); + void SendTalking(char const* title, char const* text); /*********************************************************/ /*** QUEST SYSTEM ***/ diff --git a/src/game/Group/Group.cpp b/src/game/Group/Group.cpp index c3c35403a..f1bf53142 100644 --- a/src/game/Group/Group.cpp +++ b/src/game/Group/Group.cpp @@ -790,7 +790,7 @@ void Group::MasterLoot(Creature *creature, Loot* loot) continue; //if (looter->IsWithinDistInMap(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false)) - if(looter->IsWithinLootXPDist(creature)) + if (looter->IsWithinLootXPDist(creature)) { data << looter->GetObjectGuid(); ++playerCount; @@ -1315,7 +1315,7 @@ void Group::UpdateOfflineLeader(time_t time, uint32 delay) _chooseLeader(true); } -void Group::BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int group, ObjectGuid ignore) +void Group::BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group, ObjectGuid ignore) { for (GroupReference *itr = GetFirstMember(); itr != nullptr; itr = itr->next()) { @@ -1328,7 +1328,7 @@ void Group::BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int } } -void Group::BroadcastReadyCheck(WorldPacket *packet) +void Group::BroadcastReadyCheck(WorldPacket* packet) { for (GroupReference *itr = GetFirstMember(); itr != nullptr; itr = itr->next()) { diff --git a/src/game/Group/Group.h b/src/game/Group/Group.h index 940ed753c..fd1fe7824 100644 --- a/src/game/Group/Group.h +++ b/src/game/Group/Group.h @@ -318,8 +318,8 @@ class MANGOS_DLL_SPEC Group void UpdateOfflineLeader(time_t time, uint32 delay); void BroadcastGroupUpdate(); // ignore: GUID of player that will be ignored - void BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int group=-1, ObjectGuid ignore = ObjectGuid()); - void BroadcastReadyCheck(WorldPacket *packet); + void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group=-1, ObjectGuid ignore = ObjectGuid()); + void BroadcastReadyCheck(WorldPacket* packet); void OfflineReadyCheck(); void RewardGroupAtKill(Unit* pVictim, Player* pPlayerTap); @@ -353,7 +353,7 @@ class MANGOS_DLL_SPEC Group void EndRoll(Loot* loot); void LinkMember(GroupReference *pRef) { m_memberMgr.insertFirst(pRef); } - void DelinkMember(GroupReference* /*pRef*/ ) { } + void DelinkMember(GroupReference* /*pRef*/) { } InstanceGroupBind* BindToInstance(DungeonPersistentState *save, bool permanent, bool load = false); void UnbindInstance(uint32 mapid, bool unload = false); diff --git a/src/game/Group/GroupRefManager.h b/src/game/Group/GroupRefManager.h index 0747f5612..1b63d216a 100644 --- a/src/game/Group/GroupRefManager.h +++ b/src/game/Group/GroupRefManager.h @@ -31,6 +31,6 @@ class GroupReference; class GroupRefManager : public RefManager { public: - GroupReference* getFirst() { return ((GroupReference* ) RefManager::getFirst()); } + GroupReference* getFirst() { return ((GroupReference*) RefManager::getFirst()); } }; #endif diff --git a/src/game/Guild/Guild.cpp b/src/game/Guild/Guild.cpp index f4cc25a91..9ec340237 100644 --- a/src/game/Guild/Guild.cpp +++ b/src/game/Guild/Guild.cpp @@ -632,7 +632,7 @@ void Guild::BroadcastToOfficers(WorldSession *session, std::string const& msg, u } } -void Guild::BroadcastPacket(WorldPacket *packet) +void Guild::BroadcastPacket(WorldPacket* packet) { for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) { @@ -642,7 +642,7 @@ void Guild::BroadcastPacket(WorldPacket *packet) } } -void Guild::BroadcastPacketToRank(WorldPacket *packet, uint32 rankId) +void Guild::BroadcastPacketToRank(WorldPacket* packet, uint32 rankId) { for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) { diff --git a/src/game/Guild/Guild.h b/src/game/Guild/Guild.h index 9d336cda5..c30722d48 100644 --- a/src/game/Guild/Guild.h +++ b/src/game/Guild/Guild.h @@ -259,8 +259,8 @@ class Guild void BroadcastToGuild(WorldSession *session, std::string const& msg, uint32 language = LANG_UNIVERSAL); void BroadcastToOfficers(WorldSession *session, std::string const& msg, uint32 language = LANG_UNIVERSAL); - void BroadcastPacketToRank(WorldPacket *packet, uint32 rankId); - void BroadcastPacket(WorldPacket *packet); + void BroadcastPacketToRank(WorldPacket* packet, uint32 rankId); + void BroadcastPacket(WorldPacket* packet); void BroadcastEvent(GuildEvents event, ObjectGuid guid, char const* str1 = nullptr, char const* str2 = nullptr, char const* str3 = nullptr); void BroadcastEvent(GuildEvents event, char const* str1 = nullptr, char const* str2 = nullptr, char const* str3 = nullptr) @@ -272,8 +272,8 @@ class Guild void BroadcastWorker(Do& _do, Player* except = nullptr) { for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr) - if(Player *player = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first))) - if(player != except) + if (Player *player = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first))) + if (player != except) _do(player); } @@ -305,7 +305,7 @@ class Guild MemberSlot* GetMemberSlot(std::string const& name) { for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr) - if(itr->second.Name == name) + if (itr->second.Name == name) return &itr->second; return nullptr; diff --git a/src/game/Handlers/AddonHandler.cpp b/src/game/Handlers/AddonHandler.cpp index 10a25e0c2..8a2e240f4 100644 --- a/src/game/Handlers/AddonHandler.cpp +++ b/src/game/Handlers/AddonHandler.cpp @@ -36,7 +36,7 @@ AddonHandler::~AddonHandler() { } -bool AddonHandler::BuildAddonPacket(WorldPacket *Source, WorldPacket *Target) +bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target) { ByteBuffer AddOnPacked; uLongf AddonRealSize; diff --git a/src/game/Handlers/ChatHandler.cpp b/src/game/Handlers/ChatHandler.cpp index 5ed7211ac..3c03009ed 100644 --- a/src/game/Handlers/ChatHandler.cpp +++ b/src/game/Handlers/ChatHandler.cpp @@ -331,9 +331,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (auto cooldown = ChatCooldown()) { - ChatHandler(this).PSendSysMessage( - "Please wait %u seconds before sending another message.", cooldown - ); + ChatHandler(this).PSendSysMessage("Please wait %u seconds before sending another message.", cooldown); return; } } @@ -627,20 +625,20 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) { ForwardPacketToNode(); - if(_player && _player->IsInCombat()) + if (_player && _player->IsInCombat()) break; - if(!msg.empty() || !_player->IsAFK()) + if (!msg.empty() || !_player->IsAFK()) { if (MasterPlayer* masterPlr = GetMasterPlayer()) masterPlr->afkMsg = msg; } - if(msg.empty() || !_player->IsAFK()) + if (msg.empty() || !_player->IsAFK()) { _player->ToggleAFK(); - if(_player->IsAFK() && _player->IsDND()) + if (_player->IsAFK() && _player->IsDND()) _player->ToggleDND(); } } @@ -649,17 +647,17 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) case CHAT_MSG_DND: { - if(!msg.empty() || !_player->IsDND()) + if (!msg.empty() || !_player->IsDND()) { if (MasterPlayer* masterPlr = GetMasterPlayer()) masterPlr->dndMsg = msg; } - if(msg.empty() || !_player->IsDND()) + if (msg.empty() || !_player->IsDND()) { _player->ToggleDND(); - if(_player->IsDND() && _player->IsAFK()) + if (_player->IsDND() && _player->IsAFK()) _player->ToggleAFK(); } } diff --git a/src/game/Handlers/CombatHandler.cpp b/src/game/Handlers/CombatHandler.cpp index 17e869893..433f91079 100644 --- a/src/game/Handlers/CombatHandler.cpp +++ b/src/game/Handlers/CombatHandler.cpp @@ -85,7 +85,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket & recv_data) uint32 sheathed; recv_data >> sheathed; - //DEBUG_LOG( "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed ); + //DEBUG_LOG("WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed); if (sheathed >= MAX_SHEATH_STATE) return; diff --git a/src/game/Handlers/DuelHandler.cpp b/src/game/Handlers/DuelHandler.cpp index 3b3f9fcd6..5ee081708 100644 --- a/src/game/Handlers/DuelHandler.cpp +++ b/src/game/Handlers/DuelHandler.cpp @@ -55,7 +55,7 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket) { - //DEBUG_LOG( "WORLD: received CMSG_DUEL_CANCELLED" ); + //DEBUG_LOG("WORLD: received CMSG_DUEL_CANCELLED"); auto pPlayer = GetPlayer(); // no duel requested diff --git a/src/game/Handlers/GroupHandler.cpp b/src/game/Handlers/GroupHandler.cpp index 5762a6ba8..2a6cf9a46 100644 --- a/src/game/Handlers/GroupHandler.cpp +++ b/src/game/Handlers/GroupHandler.cpp @@ -777,7 +777,7 @@ void WorldSession::BuildPartyMemberStatsPacket(Player* player, WorldPacket* data } } -void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacket *data) +void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacket* data) { uint32 mask = player->GetGroupUpdateFlag(); diff --git a/src/game/Handlers/ItemHandler.cpp b/src/game/Handlers/ItemHandler.cpp index ffaae4dac..ede7d8260 100644 --- a/src/game/Handlers/ItemHandler.cpp +++ b/src/game/Handlers/ItemHandler.cpp @@ -351,7 +351,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) data << pProto->RequiredCityRank; data << pProto->RequiredReputationFaction; - data << (pProto->RequiredReputationFaction > 0 ? pProto->RequiredReputationRank : 0); // send value only if reputation faction id setted ( needed for some items) + data << (pProto->RequiredReputationFaction > 0 ? pProto->RequiredReputationRank : 0); // send value only if reputation faction id setted (needed for some items) data << pProto->MaxCount; data << pProto->Stackable; data << pProto->ContainerSlots; @@ -451,7 +451,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) void WorldSession::HandleReadItemOpcode(WorldPacket & recv_data) { - //DEBUG_LOG( "WORLD: CMSG_READ_ITEM"); + //DEBUG_LOG("WORLD: CMSG_READ_ITEM"); uint8 bag, slot; recv_data >> bag >> slot; diff --git a/src/game/Handlers/LFGHandler.cpp b/src/game/Handlers/LFGHandler.cpp index 30024eb00..443a1e161 100644 --- a/src/game/Handlers/LFGHandler.cpp +++ b/src/game/Handlers/LFGHandler.cpp @@ -93,9 +93,9 @@ void WorldSession::HandleMeetingStoneJoinOpcode(WorldPacket& recv_data) void WorldSession::HandleMeetingStoneLeaveOpcode(WorldPacket& /*recv_data*/) { DEBUG_LOG("WORLD: Recvd CMSG_MEETINGSTONE_LEAVE"); - if(Group *grp = _player->GetGroup()) + if (Group *grp = _player->GetGroup()) { - if(grp->IsLeader(_player->GetObjectGuid()) && grp->isInLFG()) + if (grp->IsLeader(_player->GetObjectGuid()) && grp->isInLFG()) { sLFGMgr.RemoveGroupFromQueue(grp->GetId()); } @@ -114,9 +114,9 @@ void WorldSession::HandleMeetingStoneInfoOpcode(WorldPacket & /*recv_data*/) { DEBUG_LOG("WORLD: Received CMSG_MEETING_STONE_INFO"); - if(Group *grp = _player->GetGroup()) + if (Group *grp = _player->GetGroup()) { - if(grp->isInLFG()) + if (grp->isInLFG()) { SendMeetingstoneSetqueue(grp->GetLFGAreaId(), MEETINGSTONE_STATUS_JOINED_QUEUE); } diff --git a/src/game/Handlers/LootHandler.cpp b/src/game/Handlers/LootHandler.cpp index 153b848f5..fcec00160 100644 --- a/src/game/Handlers/LootHandler.cpp +++ b/src/game/Handlers/LootHandler.cpp @@ -265,7 +265,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) if (!playerGroup) continue; //if (player->IsWithinDistInMap(playerGroup, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false)) - if(player->IsWithinLootXPDist(playerGroup)) + if (player->IsWithinLootXPDist(playerGroup)) playersNear.push_back(playerGroup); } diff --git a/src/game/Handlers/MailHandler.cpp b/src/game/Handlers/MailHandler.cpp index d864167e3..f1701139d 100644 --- a/src/game/Handlers/MailHandler.cpp +++ b/src/game/Handlers/MailHandler.cpp @@ -750,7 +750,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data) /*[-ZERO] TODO recheck this size_t next_mail_size = 4+1+8+((*itr)->subject.size()+1)+4*7+1+item_count*(1+4+4+6*3*4+4+4+1+4+4+4); - if(data.wpos()+next_mail_size > maxPacketSize) + if (data.wpos()+next_mail_size > maxPacketSize) break; */ diff --git a/src/game/Handlers/MiscHandler.cpp b/src/game/Handlers/MiscHandler.cpp index 2077e45cd..dcc3f729f 100644 --- a/src/game/Handlers/MiscHandler.cpp +++ b/src/game/Handlers/MiscHandler.cpp @@ -499,7 +499,7 @@ void WorldSession::HandleSetSelectionOpcode(WorldPacket & recv_data) void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data) { - // DEBUG_LOG( "WORLD: Received CMSG_STANDSTATECHANGE" ); -- too many spam in log at lags/debug stop + // DEBUG_LOG("WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop uint32 animstate; recv_data >> animstate; @@ -1018,7 +1018,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) { // DEBUG_LOG("Party Stats guid is " I64FMTD,guid); Player *pPlayer = sObjectMgr.GetPlayer(guid); - if(pPlayer) + if (pPlayer) { WorldPacket data(MSG_INSPECT_HONOR_STATS, (8 + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 1)); data << guid; // player guid diff --git a/src/game/Handlers/MovementHandler.cpp b/src/game/Handlers/MovementHandler.cpp index 4bc37c6fe..855cfac68 100644 --- a/src/game/Handlers/MovementHandler.cpp +++ b/src/game/Handlers/MovementHandler.cpp @@ -626,7 +626,7 @@ void WorldSession::HandleMovementFlagChangeToggleAck(WorldPacket& recvData) return; } - if(mFlag != MOVEFLAG_NONE) + if (mFlag != MOVEFLAG_NONE) MovementPacketSender::SendMovementFlagChangeToObservers(pMover, mFlag, applyReceived); } diff --git a/src/game/Handlers/NPCHandler.h b/src/game/Handlers/NPCHandler.h index c1027e259..b91ca6103 100644 --- a/src/game/Handlers/NPCHandler.h +++ b/src/game/Handlers/NPCHandler.h @@ -23,7 +23,7 @@ #define __NPCHANDLER_H // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack(1) #else #pragma pack(push,1) @@ -38,7 +38,7 @@ struct PageText }; // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack() #else #pragma pack(pop) diff --git a/src/game/Handlers/PetitionsHandler.cpp b/src/game/Handlers/PetitionsHandler.cpp index f52e36b6a..a3f7b1dc6 100644 --- a/src/game/Handlers/PetitionsHandler.cpp +++ b/src/game/Handlers/PetitionsHandler.cpp @@ -368,7 +368,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) // update signs count on charter, required testing... //Item *item = _player->GetItemByGuid(petitionguid)); - //if(item) + //if (item) // item->SetUInt32Value(ITEM_FIELD_ENCHANTMENT+1, signs); // update for owner if online diff --git a/src/game/Handlers/QueryHandler.cpp b/src/game/Handlers/QueryHandler.cpp index 50c07b709..9fa0f0114 100644 --- a/src/game/Handlers/QueryHandler.cpp +++ b/src/game/Handlers/QueryHandler.cpp @@ -166,7 +166,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) Creature *unit = _player->GetMap()->GetAnyTypeCreature(guid); //if (unit == nullptr) - // sLog.outDebug( "WORLD: HandleCreatureQueryOpcode - (%u) NO SUCH UNIT! (GUID: %u, ENTRY: %u)", uint32(GUID_LOPART(guid)), guid, entry ); + // sLog.outDebug("WORLD: HandleCreatureQueryOpcode - (%u) NO SUCH UNIT! (GUID: %u, ENTRY: %u)", uint32(GUID_LOPART(guid)), guid, entry); CreatureInfo const *ci = ObjectMgr::GetCreatureTemplate(entry); if (ci) diff --git a/src/game/HardcodedEvents.cpp b/src/game/HardcodedEvents.cpp index ed95d0e13..29b0f2845 100644 --- a/src/game/HardcodedEvents.cpp +++ b/src/game/HardcodedEvents.cpp @@ -820,7 +820,7 @@ void ScourgeInvasionEvent::Update() if (!invasion1Loaded) invasion1Loaded = OnEnable(VARIABLE_NAXX_ATTACK_ZONE1, VARIABLE_NAXX_ATTACK_TIME1); - if(!invasion2Loaded) + if (!invasion2Loaded) invasion2Loaded = OnEnable(VARIABLE_NAXX_ATTACK_ZONE2, VARIABLE_NAXX_ATTACK_TIME2); // Waiting until both invasions have been loaded. OnEnable will return true @@ -934,7 +934,7 @@ Map * ScourgeInvasionEvent::GetMap(uint32 mapId, const InvasionNecropolis & invZ { uint32 instId = sMapMgr.GetContinentInstanceId(mapId, invZone.x, invZone.y); Map* pMap = sMapMgr.FindMap(mapId, instId); - if(!pMap) + if (!pMap) sLog.outError("ScourgeInvasionEvent::GetMap found no map with mapId %d, x: %d, y: %d", mapId, invZone.x, invZone.y); return pMap; } diff --git a/src/game/Mail/Mail.h b/src/game/Mail/Mail.h index 60fc48282..07de7c60e 100644 --- a/src/game/Mail/Mail.h +++ b/src/game/Mail/Mail.h @@ -358,7 +358,7 @@ struct Mail { for(MailItemInfoVec::iterator itr = items.begin(); itr != items.end(); ++itr) { - if(itr->item_guid == item_guid) + if (itr->item_guid == item_guid) { items.erase(itr); return true; diff --git a/src/game/MapNodes/MasterPlayer.h b/src/game/MapNodes/MasterPlayer.h index 3e30f5e11..2c76a3bed 100644 --- a/src/game/MapNodes/MasterPlayer.h +++ b/src/game/MapNodes/MasterPlayer.h @@ -95,13 +95,13 @@ public: // GM SYSTEMS bool IsAcceptTickets() const { return m_ExtraFlags & PLAYER_EXTRA_GM_ACCEPT_TICKETS; } - void SetAcceptTicket(bool on) { if(on) m_ExtraFlags |= PLAYER_EXTRA_GM_ACCEPT_TICKETS; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_ACCEPT_TICKETS; } + void SetAcceptTicket(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_ACCEPT_TICKETS; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_ACCEPT_TICKETS; } bool IsAcceptWhispers() const { return m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS; } bool AcceptsWhispersFrom(ObjectGuid whisperer) const { return IsAcceptWhispers() || m_allowedWhispers.find(whisperer) != m_allowedWhispers.end(); } void AddAllowedWhisperer(ObjectGuid whisperer) { m_allowedWhispers.insert(whisperer); } void ClearAllowedWhisperers() { m_allowedWhispers.clear(); } - void SetAcceptWhispers(bool on) { if(on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; } + void SetAcceptWhispers(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; } bool IsGameMaster() const { return m_ExtraFlags & PLAYER_EXTRA_GM_ON; } diff --git a/src/game/MapNodes/NodeSession.cpp b/src/game/MapNodes/NodeSession.cpp index bc8eb9cf0..a2d9385a6 100644 --- a/src/game/MapNodes/NodeSession.cpp +++ b/src/game/MapNodes/NodeSession.cpp @@ -80,7 +80,7 @@ class MasterSessionFilter final : public PacketFilter m_processType = PACKET_PROCESS_MASTER_SAFE; } - bool Process(WorldPacket * packet) { return true; } + bool Process(WorldPacket* packet) { return true; } }; void NodeSession::UnsafeUpdate(uint32 diff) diff --git a/src/game/MapNodes/NodeSession.h b/src/game/MapNodes/NodeSession.h index 7e2d420e1..079e0735b 100644 --- a/src/game/MapNodes/NodeSession.h +++ b/src/game/MapNodes/NodeSession.h @@ -97,7 +97,7 @@ public: void SendDisconnectedFromMaster(uint32 accountId); // Handlers - void HandleNull(WorldPacket& ) {} + void HandleNull(WorldPacket&) {} void HandleMasterHello(WorldPacket& pkt); void HandleNodeHello(WorldPacket& pkt); void HandleRequestFreeGuidsItems(WorldPacket& pkt); diff --git a/src/game/Maps/Cell.h b/src/game/Maps/Cell.h index 097bbbd9e..54abda5b2 100644 --- a/src/game/Maps/Cell.h +++ b/src/game/Maps/Cell.h @@ -123,7 +123,7 @@ struct MANGOS_DLL_DECL Cell template static void VisitAllObjects(float x, float y, Map *map, T &visitor, float radius, bool dont_load = true); private: - template void VisitCircle(TypeContainerVisitor &, Map &, const CellPair& , const CellPair& ) const; + template void VisitCircle(TypeContainerVisitor &, Map &, const CellPair& , const CellPair&) const; }; #endif diff --git a/src/game/Maps/CellImpl.h b/src/game/Maps/CellImpl.h index 744b8f78e..9c25ceb26 100644 --- a/src/game/Maps/CellImpl.h +++ b/src/game/Maps/CellImpl.h @@ -70,19 +70,19 @@ Cell::Visit(const CellPair &standing_cell, TypeContainerVisitor &v //no jokes here... Actually placing ASSERT() here was good idea, but //we had some problems with DynamicObjects, which pass radius = 0.0f (DB issue?) //maybe it is better to just return when radius <= 0.0f? - if(radius <= 0.0f) + if (radius <= 0.0f) { m.Visit(*this, visitor); return; } //lets limit the upper value for search radius - if(radius > 333.0f) + if (radius > 333.0f) radius = 333.0f; //lets calculate object coord offsets from cell borders. CellArea area = Cell::CalculateCellArea(x, y, radius); //if radius fits inside standing cell - if(!area) + if (!area) { m.Visit(*this, visitor); return; @@ -94,7 +94,7 @@ Cell::Visit(const CellPair &standing_cell, TypeContainerVisitor &v //if radius is known to reach cell area more than 4x4 then we should call optimized VisitCircle //currently this technique works with MAX_NUMBER_OF_CELLS 16 and higher, with lower values //there are nothing to optimize because SIZE_OF_GRID_CELL is too big... - if(((end_cell.x_coord - begin_cell.x_coord) > 4) && ((end_cell.y_coord - begin_cell.y_coord) > 4)) + if (((end_cell.x_coord - begin_cell.x_coord) > 4) && ((end_cell.y_coord - begin_cell.y_coord) > 4)) { VisitCircle(visitor, m, begin_cell, end_cell); return; @@ -111,7 +111,7 @@ Cell::Visit(const CellPair &standing_cell, TypeContainerVisitor &v { CellPair cell_pair(x,y); //lets skip standing cell since we already visited it - if(cell_pair != standing_cell) + if (cell_pair != standing_cell) { Cell r_zone(cell_pair); r_zone.data.Part.nocreate = data.Part.nocreate; @@ -145,7 +145,7 @@ Cell::VisitCircle(TypeContainerVisitor &visitor, Map &m, const Cel //if x_shift == 0 then we have too small cell area, which were already //visited at previous step, so just return from procedure... - if(x_shift == 0) + if (x_shift == 0) return; uint32 y_start = end_cell.y_coord; diff --git a/src/game/Maps/GridDefines.h b/src/game/Maps/GridDefines.h index 3214af609..f70d10af8 100644 --- a/src/game/Maps/GridDefines.h +++ b/src/game/Maps/GridDefines.h @@ -104,7 +104,7 @@ struct MANGOS_DLL_DECL CoordPair void operator<<(const uint32 val) { - if( x_coord > val ) + if (x_coord > val) x_coord -= val; else x_coord = 0; @@ -112,7 +112,7 @@ struct MANGOS_DLL_DECL CoordPair void operator>>(const uint32 val) { - if( x_coord+val < LIMIT ) + if (x_coord+val < LIMIT) x_coord += val; else x_coord = LIMIT - 1; @@ -120,7 +120,7 @@ struct MANGOS_DLL_DECL CoordPair void operator-=(const uint32 val) { - if( y_coord > val ) + if (y_coord > val) y_coord -= val; else y_coord = 0; @@ -128,7 +128,7 @@ struct MANGOS_DLL_DECL CoordPair void operator+=(const uint32 val) { - if( y_coord+val < LIMIT ) + if (y_coord+val < LIMIT) y_coord += val; else y_coord = LIMIT - 1; @@ -174,9 +174,9 @@ namespace MaNGOS inline void NormalizeMapCoord(float &c) { - if(c > MAP_HALFSIZE - 0.5) + if (c > MAP_HALFSIZE - 0.5) c = MAP_HALFSIZE - 0.5; - else if(c < -(MAP_HALFSIZE - 0.5)) + else if (c < -(MAP_HALFSIZE - 0.5)) c = -(MAP_HALFSIZE - 0.5); } inline bool IsValidZCoord(float z) diff --git a/src/game/Maps/GridNotifiers.h b/src/game/Maps/GridNotifiers.h index 33ebce291..cf2a4dc70 100644 --- a/src/game/Maps/GridNotifiers.h +++ b/src/game/Maps/GridNotifiers.h @@ -65,9 +65,9 @@ namespace MaNGOS struct MANGOS_DLL_DECL MessageDeliverer { Player const& i_player; - WorldPacket *i_message; + WorldPacket* i_message; bool i_toSelf; - MessageDeliverer(Player const& pl, WorldPacket *msg, bool to_self) : i_player(pl), i_message(msg), i_toSelf(to_self) {} + MessageDeliverer(Player const& pl, WorldPacket* msg, bool to_self) : i_player(pl), i_message(msg), i_toSelf(to_self) {} void Visit(CameraMapType &m); template void Visit(GridRefManager &) {} }; @@ -77,7 +77,7 @@ namespace MaNGOS WorldPacket* i_message; Player const* i_skipped_receiver; - MessageDelivererExcept(WorldPacket *msg, Player const* skipped) + MessageDelivererExcept(WorldPacket* msg, Player const* skipped) : i_message(msg), i_skipped_receiver(skipped) {} void Visit(CameraMapType &m); @@ -86,8 +86,8 @@ namespace MaNGOS struct MANGOS_DLL_DECL ObjectMessageDeliverer { - WorldPacket *i_message; - explicit ObjectMessageDeliverer(WorldPacket *msg) : i_message(msg) {} + WorldPacket* i_message; + explicit ObjectMessageDeliverer(WorldPacket* msg) : i_message(msg) {} void Visit(CameraMapType &m); template void Visit(GridRefManager &) {} }; @@ -95,12 +95,12 @@ namespace MaNGOS struct MANGOS_DLL_DECL MessageDistDeliverer { Player const& i_player; - WorldPacket *i_message; + WorldPacket* i_message; bool i_toSelf; bool i_ownTeamOnly; float i_dist; - MessageDistDeliverer(Player const& pl, WorldPacket *msg, float dist, bool to_self, bool ownTeamOnly) + MessageDistDeliverer(Player const& pl, WorldPacket* msg, float dist, bool to_self, bool ownTeamOnly) : i_player(pl), i_message(msg), i_toSelf(to_self), i_ownTeamOnly(ownTeamOnly), i_dist(dist) {} void Visit(CameraMapType &m); template void Visit(GridRefManager &) {} @@ -109,9 +109,9 @@ namespace MaNGOS struct MANGOS_DLL_DECL ObjectMessageDistDeliverer { WorldObject const& i_object; - WorldPacket *i_message; + WorldPacket* i_message; float i_dist; - ObjectMessageDistDeliverer(WorldObject const& obj, WorldPacket *msg, float dist) : i_object(obj), i_message(msg), i_dist(dist) {} + ObjectMessageDistDeliverer(WorldObject const& obj, WorldPacket* msg, float dist) : i_object(obj), i_message(msg), i_dist(dist) {} void Visit(CameraMapType &m); template void Visit(GridRefManager &) {} }; @@ -155,7 +155,7 @@ namespace MaNGOS { i_check = caster; Unit* owner = i_check->IsUnit() ? static_cast(i_check)->GetOwner() : nullptr; - if(owner) + if (owner) i_check = owner; } @@ -547,7 +547,7 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_fobj; } bool operator()(Player* u) { - if( i_fobj->IsFriendlyTo(u) || u->IsAlive() || u->IsTaxiFlying() || !i_fobj->CanSeeInWorld(u)) + if (i_fobj->IsFriendlyTo(u) || u->IsAlive() || u->IsTaxiFlying() || !i_fobj->CanSeeInWorld(u)) return false; return i_fobj->IsWithinDistInMap(u, i_range); @@ -588,10 +588,10 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_caster; } bool operator()(GameObject* go) const { - if(go->GetGOInfo()->type != GAMEOBJECT_TYPE_SPELL_FOCUS) + if (go->GetGOInfo()->type != GAMEOBJECT_TYPE_SPELL_FOCUS) return false; - if(go->GetGOInfo()->spellFocus.focusId != i_focusId) + if (go->GetGOInfo()->spellFocus.focusId != i_focusId) return false; float dist = (float)go->GetGOInfo()->spellFocus.dist; @@ -611,7 +611,7 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return i_obj; } bool operator()(GameObject* go) { - if(go->GetGOInfo()->type == GAMEOBJECT_TYPE_FISHINGHOLE && go->isSpawned() && i_obj.IsWithinDistInMap(go, i_range) && i_obj.IsWithinDistInMap(go, (float)go->GetGOInfo()->fishinghole.radius)) + if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_FISHINGHOLE && go->isSpawned() && i_obj.IsWithinDistInMap(go, i_range) && i_obj.IsWithinDistInMap(go, (float)go->GetGOInfo()->fishinghole.radius)) { i_range = i_obj.GetDistance(go); return true; @@ -635,7 +635,7 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return i_obj; } bool operator()(GameObject* go) { - if(go->GetEntry() == i_entry && i_obj.IsWithinDistInMap(go, i_range)) + if (go->GetEntry() == i_entry && i_obj.IsWithinDistInMap(go, i_range)) { i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check return true; @@ -659,7 +659,7 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return i_obj; } bool operator()(GameObject* go) { - if(go->GetEntry() == i_entry && i_obj.IsWithinDistInMap(go, i_range)) + if (go->GetEntry() == i_entry && i_obj.IsWithinDistInMap(go, i_range)) { if (i_conditionId && !IsConditionSatisfied(i_conditionId, go, go->GetMap(), &i_obj, CONDITION_FROM_SPELL_AREA)) return false; @@ -775,7 +775,7 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_obj; } bool operator()(Unit* u) { - if(u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && + if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && (u->IsCharmed() || u->IsFrozen() || u->HasUnitState(UNIT_STAT_CAN_NOT_REACT))) { return true; @@ -794,8 +794,8 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_obj; } bool operator()(Unit* u) { - if(u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && - !(u->HasAura(i_spell, EFFECT_INDEX_0) || u->HasAura(i_spell, EFFECT_INDEX_1) || u->HasAura(i_spell, EFFECT_INDEX_2)) ) + if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && + !(u->HasAura(i_spell, EFFECT_INDEX_0) || u->HasAura(i_spell, EFFECT_INDEX_1) || u->HasAura(i_spell, EFFECT_INDEX_2))) { return true; } @@ -814,9 +814,9 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_obj; } bool operator()(Unit* u) { - if(!i_funit->CanSeeInWorld(u)) + if (!i_funit->CanSeeInWorld(u)) return false; - if(u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u)) + if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u)) return true; return false; } @@ -852,7 +852,7 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_obj; } bool operator()(Unit* u) { - if(u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && i_obj->IsFriendlyTo(u) && u->CanSeeInWorld(i_obj)) + if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && i_obj->IsFriendlyTo(u) && u->CanSeeInWorld(i_obj)) return true; return false; } @@ -868,7 +868,7 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_obj; } bool operator()(Unit* u) { - if(u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && u->CanSeeInWorld(i_obj)) + if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && u->CanSeeInWorld(i_obj)) return true; return false; @@ -1048,10 +1048,10 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_funit; } bool operator()(Creature* u) { - if(!u->CanSeeInWorld(i_funit)) + if (!u->CanSeeInWorld(i_funit)) return false; - if(u->IsAlive() && u->IsHostileTo(i_funit) && i_funit->IsWithinDistInMap(u, u->GetAttackDistance(i_funit))) + if (u->IsAlive() && u->IsHostileTo(i_funit) && i_funit->IsWithinDistInMap(u, u->GetAttackDistance(i_funit))) return true; return false; @@ -1070,18 +1070,18 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_funit; } bool operator()(Creature* u) { - if(u == i_funit) + if (u == i_funit) return false; - if ( !u->CanAssistTo(i_funit, i_enemy) ) + if (!u->CanAssistTo(i_funit, i_enemy)) return false; // too far - if( !i_funit->IsWithinDistInMap(u, i_range) ) + if (!i_funit->IsWithinDistInMap(u, i_range)) return false; // only if see assisted creature - if( !i_funit->IsWithinLOSInMap(u) ) + if (!i_funit->IsWithinLOSInMap(u)) return false; return true; @@ -1100,15 +1100,15 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_obj; } bool operator()(Creature* u) { - if(u == i_obj) + if (u == i_obj) return false; - if(!u->CanAssistTo(i_obj,i_enemy)) + if (!u->CanAssistTo(i_obj,i_enemy)) return false; - if(!i_obj->IsWithinDistInMap(u, i_range)) + if (!i_obj->IsWithinDistInMap(u, i_range)) return false; - if(!i_obj->IsWithinLOSInMap(u)) + if (!i_obj->IsWithinLOSInMap(u)) return false; i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check @@ -1231,7 +1231,7 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return *i_obj; } bool operator()(Player* u) { - if(u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range, b_3dDist)) + if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range, b_3dDist)) return true; return false; @@ -1267,7 +1267,7 @@ namespace MaNGOS public: explicit LocalizedPacketDo(Builder& builder) : i_builder(builder) {} - void operator()( Player* p ); + void operator()(Player* p); private: Builder& i_builder; @@ -1288,7 +1288,7 @@ namespace MaNGOS for(size_t j = 0; j < i_data_cache[i].size(); ++j) delete i_data_cache[i][j]; } - void operator()( Player* p ); + void operator()(Player* p); private: Builder& i_builder; diff --git a/src/game/Maps/GridNotifiersImpl.h b/src/game/Maps/GridNotifiersImpl.h index 67d60abef..70776806d 100644 --- a/src/game/Maps/GridNotifiersImpl.h +++ b/src/game/Maps/GridNotifiersImpl.h @@ -127,7 +127,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target) if (!target->CanSeeInWorld(i_check)) return; - if (!target->IsAlive() || target->IsTaxiFlying() ) + if (!target->IsAlive() || target->IsTaxiFlying()) return; if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsImmuneToAoe()) @@ -585,7 +585,7 @@ void MaNGOS::PlayerListSearcher::Visit(PlayerMapType &m) } template -void MaNGOS::LocalizedPacketDo::operator()( Player* p ) +void MaNGOS::LocalizedPacketDo::operator()(Player* p) { int32 loc_idx = p->GetSession()->GetSessionDbLocaleIndex(); uint32 cache_idx = loc_idx + 1; @@ -607,7 +607,7 @@ void MaNGOS::LocalizedPacketDo::operator()( Player* p ) } template -void MaNGOS::LocalizedPacketListDo::operator()( Player* p ) +void MaNGOS::LocalizedPacketListDo::operator()(Player* p) { int32 loc_idx = p->GetSession()->GetSessionDbLocaleIndex(); uint32 cache_idx = loc_idx+1; diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index 03aab4ab9..1b7367807 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -476,7 +476,7 @@ void Map::Add(Transport* obj) return; } -void Map::MessageBroadcast(Player const* player, WorldPacket *msg, bool to_self) +void Map::MessageBroadcast(Player const* player, WorldPacket* msg, bool to_self) { CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); @@ -497,7 +497,7 @@ void Map::MessageBroadcast(Player const* player, WorldPacket *msg, bool to_self) cell.Visit(p, message, *this, *player, GetVisibilityDistance()); } -void Map::MessageBroadcast(WorldObject const* obj, WorldPacket *msg) +void Map::MessageBroadcast(WorldObject const* obj, WorldPacket* msg) { CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); @@ -520,7 +520,7 @@ void Map::MessageBroadcast(WorldObject const* obj, WorldPacket *msg) cell.Visit(p, message, *this, *obj, GetVisibilityDistance()); } -void Map::MessageDistBroadcast(Player const* player, WorldPacket *msg, float dist, bool to_self, bool own_team_only) +void Map::MessageDistBroadcast(Player const* player, WorldPacket* msg, float dist, bool to_self, bool own_team_only) { CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); @@ -541,7 +541,7 @@ void Map::MessageDistBroadcast(Player const* player, WorldPacket *msg, float dis cell.Visit(p, message, *this, *player, dist); } -void Map::MessageDistBroadcast(WorldObject const* obj, WorldPacket *msg, float dist) +void Map::MessageDistBroadcast(WorldObject const* obj, WorldPacket* msg, float dist) { CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); diff --git a/src/game/Maps/Map.h b/src/game/Maps/Map.h index 2086c4c88..8ded6d54c 100644 --- a/src/game/Maps/Map.h +++ b/src/game/Maps/Map.h @@ -78,7 +78,7 @@ namespace VMAP }; // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack(1) #else #pragma pack(push,1) @@ -173,7 +173,7 @@ struct AreaEntry } }; -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack() #else #pragma pack(pop) @@ -334,8 +334,8 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj // currently unused for normal maps bool CanUnload(uint32 diff) { - if(!m_unloadTimer) return false; - if(m_unloadTimer <= diff) return true; + if (!m_unloadTimer) return false; + if (m_unloadTimer <= diff) return true; m_unloadTimer -= diff; return false; } @@ -531,7 +531,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj { ASSERT(!_processingSendObjUpdates); i_objectsToClientUpdate_lock.acquire(); - i_objectsToClientUpdate.erase( obj ); + i_objectsToClientUpdate.erase(obj); i_objectsToClientUpdate_lock.release(); } // May be called from a different map ... @@ -669,7 +669,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj void SetTimer(uint32 t) { i_gridExpiry = t < MIN_GRID_DELAY ? MIN_GRID_DELAY : t; } - void SendInitSelf( Player * player ); + void SendInitSelf(Player * player); void SendInitTransports(Player * player); void SendRemoveTransports(Player * player); @@ -1064,7 +1064,7 @@ void Map::Visit(const Cell& cell, TypeContainerVisitor &visitor) const uint32 cell_x = cell.CellX(); const uint32 cell_y = cell.CellY(); - if( !cell.NoCreate() || loaded(GridPair(x,y)) ) + if (!cell.NoCreate() || loaded(GridPair(x,y))) { EnsureGridLoaded(cell); getNGrid(x, y)->Visit(cell_x, cell_y, visitor); diff --git a/src/game/Maps/MapManager.cpp b/src/game/Maps/MapManager.cpp index ab6e43610..da6461229 100644 --- a/src/game/Maps/MapManager.cpp +++ b/src/game/Maps/MapManager.cpp @@ -110,7 +110,7 @@ void MapManager::InitializeVisibilityDistanceInfo() Map* MapManager::CreateMap(uint32 id, const WorldObject* obj) { MANGOS_ASSERT(obj); - //if(!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId()); + //if (!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId()); Guard _guard(*this); Map * m = nullptr; diff --git a/src/game/Maps/MapManager.h b/src/game/Maps/MapManager.h index ffe8731a1..41d00c61e 100644 --- a/src/game/Maps/MapManager.h +++ b/src/game/Maps/MapManager.h @@ -62,7 +62,7 @@ struct MANGOS_DLL_DECL MapID bool operator<(const MapID& val) const { - if(nMapId == val.nMapId) + if (nMapId == val.nMapId) return nInstanceId < val.nInstanceId; return nMapId < val.nMapId; @@ -105,7 +105,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton MIN_MAP_UPDATE_DELAY ) + if (t > MIN_MAP_UPDATE_DELAY) t = MIN_MAP_UPDATE_DELAY; i_timer.SetInterval(t); @@ -151,7 +151,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton speed_obj.walk ) + // if (speed_obj.run > speed_obj.walk) return MOVE_WALK; } else if (moveFlags & MOVEFLAG_BACKWARD /*&& speed_obj.run >= speed_obj.run_back*/) diff --git a/src/game/Movement/spline/spline.cpp b/src/game/Movement/spline/spline.cpp index 3fe234557..3344da7d6 100644 --- a/src/game/Movement/spline/spline.cpp +++ b/src/game/Movement/spline/spline.cpp @@ -78,7 +78,7 @@ inline void C_Evaluate(const Vector3 *vertice, float t, const float (&matrix)[4] int i = 0; double c; double x = 0, y = 0, z = 0; - while ( i < 4 ) + while (i < 4) { c = matrix[0][i]*tvec.x + matrix[1][i]*tvec.y + matrix[2][i]*tvec.z + matrix[3][i]; diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index d1c608cca..da783fe36 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -504,7 +504,7 @@ void ObjectMgr::SetPlayerWorldMask(const uint64 guid, uint32 newWorldMask) //CharacterDatabase.PQuery("UPDATE characters SET world_phase_mask = %u WHERE guid = %u", newWorldMask, GUID_LOPART(guid)); } -uint32 ObjectMgr::GetSavedVariable(uint32 index, uint32 defaultValue, bool *exist) +uint32 ObjectMgr::GetSavedVariable(uint32 index, uint32 defaultValue, bool* exist) { SavedVariablesVector::iterator it; for (it = m_SavedVariables.begin(); it != m_SavedVariables.end(); ++it) @@ -772,7 +772,7 @@ uint32 ObjectMgr::GetPlayerAccountIdByPlayerName(std::string const& name) const return 0; } -PlayerCacheData* ObjectMgr::InsertPlayerInCache(Player *pPlayer) +PlayerCacheData* ObjectMgr::InsertPlayerInCache(Player* pPlayer) { auto pSession = pPlayer->GetSession(); if (!pSession) @@ -932,7 +932,7 @@ void ObjectMgr::LoadCreatureLocales() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); @@ -1004,7 +1004,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint16 menuId = fields[0].GetUInt16(); uint16 id = fields[1].GetUInt16(); @@ -1087,7 +1087,7 @@ void ObjectMgr::LoadPointOfInterestLocales() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); @@ -1370,7 +1370,7 @@ void ObjectMgr::CheckCreatureTemplates() void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* table, char const* guidEntryStr) { // Now add the auras, format "spell1 spell2 ..." - char *p, *s; + char* p,* s; std::vector val; s = p = (char*)reinterpret_cast(addon->auras); if (p) @@ -1407,7 +1407,7 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* uint32& cAura = const_cast(addon->auras[i]); cAura = uint32(val[j]); - SpellEntry const *AdditionalSpellInfo = sSpellMgr.GetSpellEntry(cAura); + SpellEntry const* AdditionalSpellInfo = sSpellMgr.GetSpellEntry(cAura); if (!AdditionalSpellInfo) { sLog.outErrorDb("Creature (%s: %u) has wrong spell %u defined in `auras` field in `%s`.", guidEntryStr, addon->guidOrEntry, cAura, table); @@ -1504,7 +1504,7 @@ void ObjectMgr::LoadEquipmentTemplates() if (!eqInfo->equipentry[j]) continue; - ItemPrototype const *itemProto = GetItemPrototype(eqInfo->equipentry[j]); + ItemPrototype const* itemProto = GetItemPrototype(eqInfo->equipentry[j]); if (!itemProto) { sLog.outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j + 1, i); @@ -1541,7 +1541,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelid) // generally for models having another model for the other team (totems) uint32 ObjectMgr::GetCreatureModelOtherTeamModel(uint32 modelId) { - if (const CreatureModelInfo *modelInfo = GetCreatureModelInfo(modelId)) + if (const CreatureModelInfo* modelInfo = GetCreatureModelInfo(modelId)) return modelInfo->modelid_other_team; return 0; @@ -1549,14 +1549,14 @@ uint32 ObjectMgr::GetCreatureModelOtherTeamModel(uint32 modelId) CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32 display_id) { - CreatureModelInfo const *minfo = GetCreatureModelInfo(display_id); + CreatureModelInfo const* minfo = GetCreatureModelInfo(display_id); if (!minfo) return nullptr; // If a model for another gender exists, 50% chance to use it if (minfo->modelid_other_gender != 0 && urand(0, 1) == 0) { - CreatureModelInfo const *minfo_tmp = GetCreatureModelInfo(minfo->modelid_other_gender); + CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(minfo->modelid_other_gender); if (!minfo_tmp) { sLog.outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", minfo->modelid, minfo->modelid_other_gender); @@ -1576,7 +1576,7 @@ void ObjectMgr::LoadCreatureModelInfo() // post processing for (uint32 i = 1; i < sCreatureModelStorage.GetMaxEntry(); ++i) { - CreatureModelInfo const *minfo = sCreatureModelStorage.LookupEntry(i); + CreatureModelInfo const* minfo = sCreatureModelStorage.LookupEntry(i); if (!minfo) continue; @@ -1628,7 +1628,7 @@ void ObjectMgr::LoadCreatureModelInfo() if (!((1 << (race - 1)) & RACEMASK_ALL_PLAYABLE)) continue; - if (CreatureModelInfo const *minfo = GetCreatureModelInfo(raceEntry->model_f)) + if (CreatureModelInfo const* minfo = GetCreatureModelInfo(raceEntry->model_f)) { if (minfo->gender != GENDER_FEMALE) sLog.outErrorDb("Table `creature_model_info` have wrong gender %u for character race %u female model id %u", minfo->gender, race, raceEntry->model_f); @@ -1651,7 +1651,7 @@ void ObjectMgr::LoadCreatureModelInfo() else sLog.outErrorDb("Table `creature_model_info` expect have data for character race %u female model id %u", race, raceEntry->model_f); - if (CreatureModelInfo const *minfo = GetCreatureModelInfo(raceEntry->model_m)) + if (CreatureModelInfo const* minfo = GetCreatureModelInfo(raceEntry->model_m)) { if (minfo->gender != GENDER_MALE) sLog.outErrorDb("Table `creature_model_info` have wrong gender %u for character race %u male model id %u", minfo->gender, race, raceEntry->model_m); @@ -1846,7 +1846,7 @@ void ObjectMgr::LoadCreatures(bool reload) do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 guid = fields[ 0].GetUInt32(); uint32 first_entry = fields[ 1].GetUInt32(); @@ -2075,7 +2075,7 @@ void ObjectMgr::LoadGameobjects(bool reload) do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 guid = fields[ 0].GetUInt32(); uint32 entry = fields[ 1].GetUInt32(); @@ -3296,7 +3296,7 @@ void ObjectMgr::FillObtainedItemsList(std::set& obtainedItems) { do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 itemId = fields[0].GetUInt32(); obtainedItems.insert(itemId); } while (result->NextRow()); @@ -3306,7 +3306,7 @@ void ObjectMgr::FillObtainedItemsList(std::set& obtainedItems) { for (uint32 spellId = 1; spellId < sSpellMgr.GetMaxSpellId(); ++spellId) { - SpellEntry const *pSpellProto = sSpellMgr.GetSpellEntry(spellId); + SpellEntry const* pSpellProto = sSpellMgr.GetSpellEntry(spellId); if (!pSpellProto) continue; @@ -3454,7 +3454,7 @@ void ObjectMgr::LoadItemPrototypes() if (proto->RequiredReputationRank == MIN_REPUTATION_RANK) sLog.outErrorDb("Item (Entry: %u) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.", i); } - // else if(proto->RequiredReputationRank > MIN_REPUTATION_RANK) + // else if (proto->RequiredReputationRank > MIN_REPUTATION_RANK) // sLog.outErrorDb("Item (Entry: %u) has RequiredReputationFaction ==0 but RequiredReputationRank > 0, rank setting is useless.",i); if (proto->Stackable == 0) @@ -3620,7 +3620,7 @@ void ObjectMgr::LoadItemPrototypes() // Item starts a quest, insert it into the quest->startItem map { if (m_QuestStartingItemsMap.find(proto->StartQuest) == m_QuestStartingItemsMap.end()) - m_QuestStartingItemsMap.insert( std::pair(proto->StartQuest, proto->ItemId) ); + m_QuestStartingItemsMap.insert(std::pair(proto->StartQuest, proto->ItemId)); else sLog.outErrorDb("Item #%u also starts quest #%u.", i, proto->StartQuest); } @@ -3648,7 +3648,7 @@ void ObjectMgr::LoadItemLocales() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); @@ -3718,7 +3718,7 @@ void ObjectMgr::LoadItemRequiredTarget() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 uiItemId = fields[0].GetUInt32(); uint32 uiType = fields[1].GetUInt32(); @@ -4586,9 +4586,9 @@ void ObjectMgr::LoadGroups() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); ++count; - Group *group = new Group; + Group* group = new Group; if (!group->LoadGroupFromDB(fields)) { group->Disband(); @@ -4620,7 +4620,7 @@ void ObjectMgr::LoadGroups() do { bar2.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); count++; uint32 memberGuidlow = fields[0].GetUInt32(); @@ -4692,7 +4692,7 @@ void ObjectMgr::LoadGroups() do { bar2.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); count++; uint32 leaderGuidLow = fields[0].GetUInt32(); @@ -4717,7 +4717,7 @@ void ObjectMgr::LoadGroups() continue; } - DungeonPersistentState *state = (DungeonPersistentState*)sMapPersistentStateMgr.AddPersistentState(mapEntry, fields[2].GetUInt32(), (time_t)fields[4].GetUInt64(), (fields[5].GetUInt32() == 0), true); + DungeonPersistentState* state = (DungeonPersistentState*)sMapPersistentStateMgr.AddPersistentState(mapEntry, fields[2].GetUInt32(), (time_t)fields[4].GetUInt64(), (fields[5].GetUInt32() == 0), true); group->BindToInstance(state, fields[3].GetBool(), true); } while (result->NextRow()); @@ -4788,7 +4788,7 @@ void ObjectMgr::LoadQuests() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); std::unique_ptr newQuest = std::make_unique(fields); m_QuestTemplatesMap[newQuest->GetQuestId()] = std::move(newQuest); @@ -5343,7 +5343,7 @@ void ObjectMgr::LoadQuests() // check QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE for (uint32 i = 0; i < sSpellMgr.GetMaxSpellId(); ++i) { - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(i); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(i); if (!spellInfo) continue; @@ -5412,7 +5412,7 @@ void ObjectMgr::LoadQuestLocales() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); @@ -5541,7 +5541,7 @@ void ObjectMgr::LoadPetCreateSpells() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 creature_id = fields[0].GetUInt32(); @@ -5606,7 +5606,7 @@ void ObjectMgr::LoadPetCreateSpells() std::map learnCache; for (uint32 spell_id = 1; spell_id < sSpellMgr.GetMaxSpellId(); ++spell_id) { - SpellEntry const *spellproto = sSpellMgr.GetSpellEntry(spell_id); + SpellEntry const* spellproto = sSpellMgr.GetSpellEntry(spell_id); if (!spellproto) continue; @@ -5758,7 +5758,7 @@ void ObjectMgr::LoadPageTextLocales() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); @@ -5900,7 +5900,7 @@ void ObjectMgr::LoadNPCText() { ++count; bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 textID = fields[0].GetUInt32(); if (!textID) @@ -5959,7 +5959,7 @@ public: uint32 item_guid = 0; if (result) { - Field *fields2 = result->Fetch(); + Field* fields2 = result->Fetch(); item_guid = fields2[0].GetUInt32(); delete result; @@ -6020,9 +6020,9 @@ public: do { - Field * fields = result->Fetch(); + Field* fields = result->Fetch(); - Mail *m = new Mail; + Mail* m = new Mail; m->messageID = fields[0].GetUInt32(); m->messageType = fields[1].GetUInt8(); m->sender = fields[2].GetUInt32(); @@ -6160,7 +6160,7 @@ void ObjectMgr::LoadQuestAreaTriggers() { ++count; bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 trigger_ID = fields[0].GetUInt32(); uint32 quest_ID = fields[1].GetUInt32(); @@ -6224,7 +6224,7 @@ void ObjectMgr::LoadTavernAreaTriggers() { ++count; bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 triggerId = fields[0].GetUInt32(); @@ -6268,7 +6268,7 @@ void ObjectMgr::LoadBattlegroundEntranceTriggers() { ++count; bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 triggerId = fields[0].GetUInt32(); @@ -6412,7 +6412,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, Team team, bool allowed_alt_t } } - CreatureInfo const *mount_info = GetCreatureTemplate(mount_entry); + CreatureInfo const* mount_info = GetCreatureTemplate(mount_entry); if (!mount_info) return 0; @@ -6420,7 +6420,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, Team team, bool allowed_alt_t if (!mount_id) return 0; - CreatureModelInfo const *minfo = GetCreatureModelRandomGender(mount_id); + CreatureModelInfo const* minfo = GetCreatureModelRandomGender(mount_id); if (minfo) mount_id = minfo->modelid; @@ -6451,7 +6451,7 @@ void ObjectMgr::LoadGraveyardZones() { ++count; bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 safeLocId = fields[0].GetUInt32(); uint32 zoneId = fields[1].GetUInt32(); @@ -6464,7 +6464,7 @@ void ObjectMgr::LoadGraveyardZones() continue; } - const auto *areaEntry = AreaEntry::GetById(zoneId); + const auto* areaEntry = AreaEntry::GetById(zoneId); if (!areaEntry) { sLog.outErrorDb("Table `game_graveyard_zone` has record for not existing zone id (%u), skipped.", zoneId); @@ -6492,7 +6492,7 @@ void ObjectMgr::LoadGraveyardZones() sLog.outString(">> Loaded %u graveyard-zone links", count); } -WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, Team team) +WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, Team team) { // search for zone associated closest graveyard uint32 zoneId = sTerrainMgr.GetZoneId(MapId, x, y, z); @@ -6654,7 +6654,7 @@ void ObjectMgr::LoadWorldSafeLocsFacing() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 safeLocId = fields[0].GetUInt32(); float orientation = fields[1].GetFloat(); @@ -6704,7 +6704,7 @@ void ObjectMgr::LoadAreaTriggerTeleports() { ++count; bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 triggerId = fields[0].GetUInt32(); @@ -6807,7 +6807,7 @@ void ObjectMgr::PackGroupIds() { do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); @@ -6954,7 +6954,7 @@ void ObjectMgr::LoadGameObjectLocales() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); @@ -7251,7 +7251,7 @@ void ObjectMgr::LoadGameobjectsRequirements() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); if (!GetGOData(guid)) @@ -7327,7 +7327,7 @@ void ObjectMgr::LoadExplorationBaseXP() { ++count; bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 level = fields[0].GetUInt32(); uint32 basexp = fields[1].GetUInt32(); @@ -7374,7 +7374,7 @@ void ObjectMgr::LoadPetNames() { ++count; bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); std::string word = fields[0].GetString(); uint32 entry = fields[1].GetUInt32(); @@ -7408,7 +7408,7 @@ std::string ObjectMgr::GeneratePetName(uint32 entry) if (list0.empty() || list1.empty()) { - CreatureInfo const *cinfo = GetCreatureTemplate(entry); + CreatureInfo const* cinfo = GetCreatureTemplate(entry); char const* petname = GetPetName(cinfo->beast_family, sWorld.GetDefaultDbcLocale()); if (!petname) petname = cinfo->name; @@ -7443,11 +7443,11 @@ void ObjectMgr::LoadCorpses() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - Corpse *corpse = new Corpse; + Corpse* corpse = new Corpse; if (!corpse->LoadFromDB(guid, fields)) { delete corpse; @@ -7630,7 +7630,7 @@ void ObjectMgr::LoadReputationRewardRate() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 factionId = fields[0].GetUInt32(); @@ -7640,7 +7640,7 @@ void ObjectMgr::LoadReputationRewardRate() repRate.creature_rate = fields[2].GetFloat(); repRate.spell_rate = fields[3].GetFloat(); - FactionEntry const *factionEntry = GetFactionEntry(factionId); + FactionEntry const* factionEntry = GetFactionEntry(factionId); if (!factionEntry) { sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_reward_rate`", factionId); @@ -7700,7 +7700,7 @@ void ObjectMgr::LoadReputationOnKill() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 creature_id = fields[0].GetUInt32(); @@ -7724,7 +7724,7 @@ void ObjectMgr::LoadReputationOnKill() if (repOnKill.repfaction1) { - FactionEntry const *factionEntry1 = GetFactionEntry(repOnKill.repfaction1); + FactionEntry const* factionEntry1 = GetFactionEntry(repOnKill.repfaction1); if (!factionEntry1) { sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.repfaction1); @@ -7734,7 +7734,7 @@ void ObjectMgr::LoadReputationOnKill() if (repOnKill.repfaction2) { - FactionEntry const *factionEntry2 = GetFactionEntry(repOnKill.repfaction2); + FactionEntry const* factionEntry2 = GetFactionEntry(repOnKill.repfaction2); if (!factionEntry2) { sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.repfaction2); @@ -7774,7 +7774,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 factionId = fields[0].GetUInt32(); @@ -7793,7 +7793,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() repTemplate.faction_rate[3] = fields[11].GetFloat(); repTemplate.faction_rank[3] = fields[12].GetUInt32(); - FactionEntry const *factionEntry = GetFactionEntry(factionId); + FactionEntry const* factionEntry = GetFactionEntry(factionId); if (!factionEntry) { @@ -7805,7 +7805,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() { if (repTemplate.faction[i]) { - FactionEntry const *factionSpillover = GetFactionEntry(repTemplate.faction[i]); + FactionEntry const* factionSpillover = GetFactionEntry(repTemplate.faction[i]); if (!factionSpillover) { @@ -7827,25 +7827,25 @@ void ObjectMgr::LoadReputationSpilloverTemplate() } } - FactionEntry const *factionEntry0 = GetFactionEntry(repTemplate.faction[0]); + FactionEntry const* factionEntry0 = GetFactionEntry(repTemplate.faction[0]); if (repTemplate.faction[0] && !factionEntry0) { sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[0]); continue; } - FactionEntry const *factionEntry1 = GetFactionEntry(repTemplate.faction[1]); + FactionEntry const* factionEntry1 = GetFactionEntry(repTemplate.faction[1]); if (repTemplate.faction[1] && !factionEntry1) { sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[1]); continue; } - FactionEntry const *factionEntry2 = GetFactionEntry(repTemplate.faction[2]); + FactionEntry const* factionEntry2 = GetFactionEntry(repTemplate.faction[2]); if (repTemplate.faction[2] && !factionEntry2) { sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[2]); continue; } - FactionEntry const *factionEntry3 = GetFactionEntry(repTemplate.faction[3]); + FactionEntry const* factionEntry3 = GetFactionEntry(repTemplate.faction[3]); if (repTemplate.faction[3] && !factionEntry3) { sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]); @@ -7886,7 +7886,7 @@ void ObjectMgr::LoadPointsOfInterest() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 point_id = fields[0].GetUInt32(); @@ -7973,7 +7973,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelationsMap& map, char const* tab do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); uint32 quest = fields[1].GetUInt32(); @@ -8157,7 +8157,7 @@ void ObjectMgr::LoadTaxiPathTransitions() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 inPath = fields[0].GetUInt32(); uint32 outPath = fields[1].GetUInt32(); @@ -8802,7 +8802,7 @@ void ObjectMgr::LoadBroadcastTextLocales() sLog.outString(">> Loaded %u broadcast text locales.", count); } -const char *ObjectMgr::GetBroadcastText(uint32 id, int locale_index, uint8 gender, bool forceGender) const +const char* ObjectMgr::GetBroadcastText(uint32 id, int locale_index, uint8 gender, bool forceGender) const { if (BroadcastText const* bct = GetBroadcastTextLocale(id)) { @@ -8883,7 +8883,7 @@ bool ObjectMgr::LoadMangosStrings(DatabaseType& db, char const* table, int32 min do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); int32 entry = fields[0].GetInt32(); @@ -8974,11 +8974,11 @@ bool ObjectMgr::LoadMangosStrings(DatabaseType& db, char const* table, int32 min return true; } -const char *ObjectMgr::GetMangosString(int32 entry, int locale_idx) const +const char* ObjectMgr::GetMangosString(int32 entry, int locale_idx) const { // locale_idx==-1 -> default, locale_idx >= 0 in to idx+1 // Content[0] always exist if exist MangosStringLocale - if (MangosStringLocale const *msl = GetMangosStringLocale(entry)) + if (MangosStringLocale const* msl = GetMangosStringLocale(entry)) { if ((int32)msl->Content.size() > locale_idx + 1 && !msl->Content[locale_idx + 1].empty()) return msl->Content[locale_idx + 1].c_str(); @@ -9016,7 +9016,7 @@ bool ObjectMgr::LoadQuestGreetings() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); uint8 type = fields[1].GetUInt8(); @@ -9112,7 +9112,7 @@ bool ObjectMgr::LoadTrainerGreetings() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); if (!ObjectMgr::GetCreatureTemplate(entry)) @@ -9177,12 +9177,12 @@ void ObjectMgr::LoadFishingBaseSkillLevel() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); int32 skill = fields[1].GetInt32(); - const auto *fArea = AreaEntry::GetById(entry); + const auto* fArea = AreaEntry::GetById(entry); if (!fArea) { sLog.outErrorDb("AreaId %u defined in `skill_fishing_base_level` does not exist", entry); @@ -9198,7 +9198,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() sLog.outString(">> Loaded %u areas for fishing base skill level", count); } -SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial) +SkillRangeType GetSkillRangeType(SkillLineEntry const* pSkill, bool racial) { switch (pSkill->categoryId) { @@ -9253,7 +9253,7 @@ void ObjectMgr::LoadGameTele() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); GameTele gt; @@ -9390,7 +9390,7 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates) uint32 entry = fields[0].GetUInt32(); uint32 spell = fields[1].GetUInt32(); - SpellEntry const *spellinfo = sSpellMgr.GetSpellEntry(spell); + SpellEntry const* spellinfo = sSpellMgr.GetSpellEntry(spell); if (!spellinfo) { sLog.outErrorDb("Table `%s` (Entry: %u ) has non existing spell %u, ignore", tableName, entry, spell); @@ -10230,7 +10230,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float // We use spawn coords to spawn if (!map->Instanceable() && map->IsLoaded(x, y)) { - GameObject *go = new GameObject; + GameObject* go = new GameObject; if (!go->LoadFromDB(guid, map)) { sLog.outError("AddGOData: cannot add gameobject entry %u to map", entry); @@ -10266,7 +10266,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, const Position& pos) // We use spawn coords to spawn if (!map->Instanceable() && map->IsLoaded(data.posX, data.posY)) { - Creature *creature = new Creature; + Creature* creature = new Creature; if (!creature->LoadFromDB(guid, map)) { sLog.outError("AddCreature: cannot add creature entry %u to map", guid); @@ -10281,7 +10281,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, const Position& pos) uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float x, float y, float z, float o, uint32 spawntimedelay) { - CreatureInfo const *cInfo = GetCreatureTemplate(entry); + CreatureInfo const* cInfo = GetCreatureTemplate(entry); if (!cInfo) return 0; Map* map = const_cast(sMapMgr.FindMap(mapId)); @@ -10392,7 +10392,7 @@ void ObjectMgr::LoadFactionChangeReputations() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 alliance = fields[0].GetUInt32(); uint32 horde = fields[1].GetUInt32(); @@ -10434,7 +10434,7 @@ void ObjectMgr::LoadFactionChangeSpells() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 alliance = fields[0].GetUInt32(); uint32 horde = fields[1].GetUInt32(); @@ -10476,7 +10476,7 @@ void ObjectMgr::LoadFactionChangeItems() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 alliance = fields[0].GetUInt32(); uint32 horde = fields[1].GetUInt32(); @@ -10518,7 +10518,7 @@ void ObjectMgr::LoadFactionChangeQuests() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 alliance = fields[0].GetUInt32(); uint32 horde = fields[1].GetUInt32(); @@ -10560,7 +10560,7 @@ void ObjectMgr::LoadFactionChangeMounts() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint8 RaceId = fields[0].GetUInt8(); uint8 MountNum = fields[1].GetUInt8(); @@ -10606,7 +10606,7 @@ void ObjectMgr::RestoreDeletedItems() do { bar.step(); - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); uint32 memberGuidlow = fields[1].GetUInt32(); @@ -10618,7 +10618,7 @@ void ObjectMgr::RestoreDeletedItems() ObjectGuid memberGuid = ObjectGuid(HIGHGUID_PLAYER, memberGuidlow); Player* pPlayer = ObjectAccessor::FindPlayerNotInWorld(memberGuid); - if (Item* restoredItem = Item::CreateItem(itemEntry, stackCount ? stackCount : 1, pPlayer ? pPlayer : (const Player *) 0)) + if (Item* restoredItem = Item::CreateItem(itemEntry, stackCount ? stackCount : 1, pPlayer)) { // save new item before send restoredItem->SaveToDB(); @@ -10892,7 +10892,7 @@ void ObjectMgr::GetAreaLocaleString(uint32 entry, int32 loc_idx, std::string* na { if (loc_idx >= 0) { - if (const auto *al = GetAreaLocale(entry)) + if (const auto* al = GetAreaLocale(entry)) if (namePtr && al->Name.size() > size_t(loc_idx) && !al->Name[loc_idx].empty()) *namePtr = al->Name[loc_idx].c_str(); } diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 7ad979145..4462d6ee5 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -273,7 +273,7 @@ typedef std::pair MAX_PLAYER_NAME for support declined names ) @@ -596,11 +596,11 @@ class ObjectMgr static Player* GetPlayer(const char* name) { return ObjectAccessor::FindPlayerByName(name);} static Player* GetPlayer(ObjectGuid guid) { return ObjectAccessor::FindPlayer(guid); } - static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry(id); } + static GameObjectInfo const* GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry(id); } void LoadGameobjectInfo(); void CheckGameObjectInfos(); - void AddGameobjectInfo(GameObjectInfo *goinfo); + void AddGameobjectInfo(GameObjectInfo* goinfo); void LoadGameobjectsRequirements(); GameObjectUseRequirement const* GetGameObjectUseRequirement(ObjectGuid guid) const; std::map _gobjRequirements; @@ -613,18 +613,18 @@ class ObjectMgr GroupMap::iterator GetGroupMapBegin() { return m_GroupMap.begin(); } GroupMap::iterator GetGroupMapEnd() { return m_GroupMap.end(); } - static CreatureInfo const *GetCreatureTemplate( uint32 id ); - CreatureModelInfo const *GetCreatureModelInfo( uint32 modelid ); + static CreatureInfo const* GetCreatureTemplate(uint32 id); + CreatureModelInfo const* GetCreatureModelInfo(uint32 modelid); CreatureModelInfo const* GetCreatureModelRandomGender(uint32 display_id); uint32 GetCreatureModelOtherTeamModel(uint32 modelId); - EquipmentInfo const *GetEquipmentInfo( uint32 entry ); - static CreatureDataAddon const *GetCreatureAddon( uint32 lowguid ) + EquipmentInfo const* GetEquipmentInfo(uint32 entry); + static CreatureDataAddon const* GetCreatureAddon(uint32 lowguid) { return sCreatureDataAddonStorage.LookupEntry(lowguid); } - static CreatureDataAddon const *GetCreatureTemplateAddon( uint32 entry ) + static CreatureDataAddon const* GetCreatureTemplateAddon(uint32 entry) { return sCreatureInfoAddonStorage.LookupEntry(entry); } @@ -635,17 +635,17 @@ class ObjectMgr PlayerClassInfo const* GetPlayerClassInfo(uint32 class_) const { - if(class_ >= MAX_CLASSES) return nullptr; + if (class_ >= MAX_CLASSES) return nullptr; return &m_PlayerClassInfo[class_]; } void GetPlayerClassLevelInfo(uint32 class_,uint32 level, PlayerClassLevelInfo* info) const; PlayerInfo const* GetPlayerInfo(uint32 race, uint32 class_) const { - if(race >= MAX_RACES) return nullptr; - if(class_ >= MAX_CLASSES) return nullptr; + if (race >= MAX_RACES) return nullptr; + if (class_ >= MAX_CLASSES) return nullptr; PlayerInfo const* info = &m_PlayerInfo[race][class_]; - if(info->displayId_m==0 || info->displayId_f==0) return nullptr; + if (info->displayId_m==0 || info->displayId_f==0) return nullptr; return info; } void GetPlayerLevelInfo(uint32 race, uint32 class_,uint32 level, PlayerLevelInfo* info) const; @@ -657,9 +657,9 @@ class ObjectMgr uint32 GetPlayerAccountIdByGUID(ObjectGuid guid) const; uint32 GetPlayerAccountIdByPlayerName(std::string const& name) const; - uint32 GetNearestTaxiNode( float x, float y, float z, uint32 mapid, Team team ); - void GetTaxiPath( uint32 source, uint32 destination, uint32 &path, uint32 &cost); - uint32 GetTaxiMountDisplayId( uint32 id, Team team, bool allowed_alt_team = false); + uint32 GetNearestTaxiNode(float x, float y, float z, uint32 mapid, Team team); + void GetTaxiPath(uint32 source, uint32 destination, uint32 &path, uint32 &cost); + uint32 GetTaxiMountDisplayId(uint32 id, Team team, bool allowed_alt_team = false); void LoadTaxiPathTransitions(); TaxiPathTransitionsMapBounds GetTaxiPathTransitionsMapBounds(uint32 entry) const @@ -685,7 +685,7 @@ class ObjectMgr uint32 GetQuestForAreaTrigger(uint32 triggerId) const { auto itr = m_QuestAreaTriggerMap.find(triggerId); - if(itr != m_QuestAreaTriggerMap.end()) + if (itr != m_QuestAreaTriggerMap.end()) return itr->second; return 0; } @@ -699,7 +699,7 @@ class ObjectMgr return m_GameObjectForQuestSet.find(entry) != m_GameObjectForQuestSet.end(); } - WorldSafeLocsEntry const *GetClosestGraveYard(float x, float y, float z, uint32 MapId, Team team); + WorldSafeLocsEntry const* GetClosestGraveYard(float x, float y, float z, uint32 MapId, Team team); bool AddGraveYardLink(uint32 id, uint32 zone, Team team, bool inDB = true); void RemoveGraveYardLink(uint32 id, uint32 zone, Team team, bool inDB = false); void LoadGraveyardZones(); @@ -709,8 +709,8 @@ class ObjectMgr AreaTriggerTeleport const* GetAreaTriggerTeleport(uint32 trigger) const { - auto itr = m_AreaTriggerTeleportMap.find( trigger ); - if( itr != m_AreaTriggerTeleportMap.end( ) ) + auto itr = m_AreaTriggerTeleportMap.find(trigger); + if (itr != m_AreaTriggerTeleportMap.end()) return &itr->second; return nullptr; } @@ -736,8 +736,8 @@ class ObjectMgr BattlegroundEntranceTrigger const* GetBattlegroundEntranceTrigger(uint32 trigger) const { - auto itr = m_BGEntranceTriggersMap.find( trigger ); - if( itr != m_BGEntranceTriggersMap.end( ) ) + auto itr = m_BGEntranceTriggersMap.find(trigger); + if (itr != m_BGEntranceTriggersMap.end()) return &itr->second; return nullptr; } @@ -754,7 +754,7 @@ class ObjectMgr ReputationOnKillEntry const* GetReputationOnKillEntry(uint32 id) const { auto itr = m_RepOnKillMap.find(id); - if(itr != m_RepOnKillMap.end()) + if (itr != m_RepOnKillMap.end()) return &itr->second; return nullptr; } @@ -771,7 +771,7 @@ class ObjectMgr PointOfInterest const* GetPointOfInterest(uint32 id) const { auto itr = m_PointsOfInterestMap.find(id); - if(itr != m_PointsOfInterestMap.end()) + if (itr != m_PointsOfInterestMap.end()) return &itr->second; return nullptr; } @@ -779,7 +779,7 @@ class ObjectMgr PetCreateSpellEntry const* GetPetCreateSpellEntry(uint32 id) const { auto itr = m_PetCreateSpellMap.find(id); - if(itr != m_PetCreateSpellMap.end()) + if (itr != m_PetCreateSpellMap.end()) return &itr->second; return nullptr; } @@ -913,10 +913,10 @@ class ObjectMgr uint32 CreateItemText(std::string text); void AddItemText(uint32 itemTextId, std::string text) { m_ItemTextsMap[itemTextId] = text; } - std::string GetItemText( uint32 id ) + std::string GetItemText(uint32 id) { - ItemTextMap::const_iterator itr = m_ItemTextsMap.find( id ); - if ( itr != m_ItemTextsMap.end() ) + ItemTextMap::const_iterator itr = m_ItemTextsMap.find(id); + if (itr != m_ItemTextsMap.end()) return itr->second; return "There is no info for this item"; } @@ -957,7 +957,7 @@ class ObjectMgr CreatureLocale const* GetCreatureLocale(uint32 entry) const { auto itr = m_CreatureLocaleMap.find(entry); - if(itr==m_CreatureLocaleMap.end()) return nullptr; + if (itr==m_CreatureLocaleMap.end()) return nullptr; return &itr->second; } @@ -971,49 +971,49 @@ class ObjectMgr GameObjectLocale const* GetGameObjectLocale(uint32 entry) const { auto itr = m_GameObjectLocaleMap.find(entry); - if(itr==m_GameObjectLocaleMap.end()) return nullptr; + if (itr==m_GameObjectLocaleMap.end()) return nullptr; return &itr->second; } ItemLocale const* GetItemLocale(uint32 entry) const { auto itr = m_ItemLocaleMap.find(entry); - if(itr==m_ItemLocaleMap.end()) return nullptr; + if (itr==m_ItemLocaleMap.end()) return nullptr; return &itr->second; } QuestLocale const* GetQuestLocale(uint32 entry) const { auto itr = m_QuestLocaleMap.find(entry); - if(itr==m_QuestLocaleMap.end()) return nullptr; + if (itr==m_QuestLocaleMap.end()) return nullptr; return &itr->second; } NpcText const* GetNpcText(uint32 entry) const { auto itr = m_NpcTextMap.find(entry); - if(itr==m_NpcTextMap.end()) return nullptr; + if (itr==m_NpcTextMap.end()) return nullptr; return &itr->second; } PageTextLocale const* GetPageTextLocale(uint32 entry) const { auto itr = m_PageTextLocaleMap.find(entry); - if(itr==m_PageTextLocaleMap.end()) return nullptr; + if (itr==m_PageTextLocaleMap.end()) return nullptr; return &itr->second; } GossipMenuItemsLocale const* GetGossipMenuItemsLocale(uint32 entry) const { auto itr = m_GossipMenuItemsLocaleMap.find(entry); - if(itr==m_GossipMenuItemsLocaleMap.end()) return nullptr; + if (itr==m_GossipMenuItemsLocaleMap.end()) return nullptr; return &itr->second; } PointOfInterestLocale const* GetPointOfInterestLocale(uint32 poi_id) const { auto itr = m_PointOfInterestLocaleMap.find(poi_id); - if(itr==m_PointOfInterestLocaleMap.end()) return nullptr; + if (itr==m_PointOfInterestLocaleMap.end()) return nullptr; return &itr->second; } @@ -1028,7 +1028,7 @@ class ObjectMgr GameObjectDataPair const* GetGODataPair(uint32 guid) const { auto itr = m_GameObjectDataMap.find(guid); - if(itr==m_GameObjectDataMap.end()) return nullptr; + if (itr==m_GameObjectDataMap.end()) return nullptr; return &*itr; } @@ -1064,12 +1064,12 @@ class ObjectMgr MangosStringLocale const* GetMangosStringLocale(int32 entry) const { auto itr = m_MangosStringLocaleMap.find(entry); - if(itr==m_MangosStringLocaleMap.end()) return nullptr; + if (itr==m_MangosStringLocaleMap.end()) return nullptr; return &itr->second; } - const char *GetMangosString(int32 entry, int locale_idx) const; - const char *GetMangosStringForDBCLocale(int32 entry) const { return GetMangosString(entry,DBCLocaleIndex); } + const char* GetMangosString(int32 entry, int locale_idx) const; + const char* GetMangosStringForDBCLocale(int32 entry) const { return GetMangosString(entry,DBCLocaleIndex); } int32 GetDBCLocaleIndex() const { return DBCLocaleIndex; } void SetDBCLocaleIndex(uint32 lang) { DBCLocaleIndex = GetIndexForLocale(LocaleConstant(lang)); } @@ -1126,7 +1126,7 @@ class ObjectMgr GameTele const* GetGameTele(uint32 id) const { auto itr = m_GameTeleMap.find(id); - if(itr==m_GameTeleMap.end()) return nullptr; + if (itr==m_GameTeleMap.end()) return nullptr; return &itr->second; } @@ -1138,7 +1138,7 @@ class ObjectMgr uint32 GetNpcGossip(uint32 entry) const { auto iter = m_CacheNpcTextIdMap.find(entry); - if(iter == m_CacheNpcTextIdMap.end()) + if (iter == m_CacheNpcTextIdMap.end()) return 0; return iter->second; @@ -1147,7 +1147,7 @@ class ObjectMgr TrainerSpellData const* GetNpcTrainerSpells(uint32 entry) const { auto iter = m_CacheTrainerSpellMap.find(entry); - if(iter == m_CacheTrainerSpellMap.end()) + if (iter == m_CacheTrainerSpellMap.end()) return nullptr; return &iter->second; @@ -1156,7 +1156,7 @@ class ObjectMgr TrainerSpellData const* GetNpcTrainerTemplateSpells(uint32 entry) const { auto iter = m_CacheTrainerTemplateSpellMap.find(entry); - if(iter == m_CacheTrainerTemplateSpellMap.end()) + if (iter == m_CacheTrainerTemplateSpellMap.end()) return nullptr; return &iter->second; @@ -1165,7 +1165,7 @@ class ObjectMgr VendorItemData const* GetNpcVendorItemList(uint32 entry) const { auto iter = m_CacheVendorItemMap.find(entry); - if(iter == m_CacheVendorItemMap.end()) + if (iter == m_CacheVendorItemMap.end()) return nullptr; return &iter->second; @@ -1174,7 +1174,7 @@ class ObjectMgr VendorItemData const* GetNpcVendorTemplateItemList(uint32 entry) const { auto iter = m_CacheVendorTemplateItemMap.find(entry); - if(iter == m_CacheVendorTemplateItemMap.end()) + if (iter == m_CacheVendorTemplateItemMap.end()) return nullptr; return &iter->second; @@ -1230,7 +1230,7 @@ class ObjectMgr void _SaveVariable(const SavedVariable& toSave); void InitSavedVariable(uint32 index, uint32 value); - uint32 GetSavedVariable(uint32 index, uint32 defaultValue = 0, bool *exist = nullptr); + uint32 GetSavedVariable(uint32 index, uint32 defaultValue = 0, bool* exist = nullptr); void SetSavedVariable(uint32 index, uint32 value, bool SaveToDb = false); void LoadVariable(uint32 index, uint32* variable, uint32 defaultValue, uint32 maxValue=0, uint32 minValue=0); @@ -1243,11 +1243,11 @@ class ObjectMgr PlayerCacheData* GetPlayerDataByGUID(uint32 lowGuid) const; PlayerCacheData* GetPlayerDataByName(std::string const& name) const; void GetPlayerDataForAccount(uint32 accountId, std::list& data) const; - PlayerCacheData* InsertPlayerInCache(Player *pPlayer); + PlayerCacheData* InsertPlayerInCache(Player* pPlayer); PlayerCacheData* InsertPlayerInCache(uint32 lowGuid, uint32 race, uint32 _class, uint32 uiGender, uint32 account, std::string const& name, uint32 level, uint32 zoneId); void DeletePlayerFromCache(uint32 lowGuid); void ChangePlayerNameInCache(uint32 lowGuid, std::string const& oldName, std::string const& newName); - void UpdatePlayerCachedPosition(Player *pPlayer); + void UpdatePlayerCachedPosition(Player* pPlayer); void UpdatePlayerCachedPosition(uint32 lowGuid, uint32 mapId, float posX, float posY, float posZ, float o, bool inFlight); void UpdatePlayerCachedPosition(PlayerCacheData* data, uint32 mapId, float posX, float posY, float posZ, float o, bool inFlight); void UpdatePlayerCache(Player* pPlayer); diff --git a/src/game/ObjectPosSelector.h b/src/game/ObjectPosSelector.h index 886a74fae..c8ea1c7de 100644 --- a/src/game/ObjectPosSelector.h +++ b/src/game/ObjectPosSelector.h @@ -56,14 +56,14 @@ struct ObjectPosSelector bool NextAngle(float& angle); bool NextUsedAngle(float& angle); - bool NextPosibleAngle( float& angle ); + bool NextPosibleAngle(float& angle); - bool CheckAngle(UsedPosList::value_type const& nextUsedPos, float sign, float angle ) const + bool CheckAngle(UsedPosList::value_type const& nextUsedPos, float sign, float angle) const { float angle_step2 = GetAngle(nextUsedPos.second); float next_angle = nextUsedPos.first; - if(nextUsedPos.second.sign * sign < 0) // last node from diff. list (-pi+alpha) + if (nextUsedPos.second.sign * sign < 0) // last node from diff. list (-pi+alpha) next_angle = 2.0f*M_PI_F-next_angle; // move to positive return fabs(angle)+angle_step2 <= next_angle; @@ -71,13 +71,13 @@ struct ObjectPosSelector bool CheckOriginal() const { - return (m_UsedPosLists[USED_POS_PLUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_PLUS].begin(),1.0,0)) && - (m_UsedPosLists[USED_POS_MINUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_MINUS].begin(),-1.0,0)); + return (m_UsedPosLists[USED_POS_PLUS].empty() || CheckAngle(*m_UsedPosLists[USED_POS_PLUS].begin(),1.0,0)) && + (m_UsedPosLists[USED_POS_MINUS].empty() || CheckAngle(*m_UsedPosLists[USED_POS_MINUS].begin(),-1.0,0)); } bool IsNonBalanced() const { return m_UsedPosLists[USED_POS_PLUS].empty() != m_UsedPosLists[USED_POS_MINUS].empty(); } - bool NextAngleFor( UsedPosList::value_type const& usedPos, float sign, UsedPosType uptype, float &angle ) + bool NextAngleFor(UsedPosList::value_type const& usedPos, float sign, UsedPosType uptype, float &angle) { float angle_step = GetAngle(usedPos.second); @@ -85,10 +85,10 @@ struct ObjectPosSelector angle = usedPos.first * usedPos.second.sign + angle_step * sign; UsedPosList::value_type const* nextNode = nextUsedPos(uptype); - if(nextNode) + if (nextNode) { // if next node permit use selected angle, then do it - if(!CheckAngle(*nextNode, sign, angle)) + if (!CheckAngle(*nextNode, sign, angle)) { m_smallStepOk[uptype] = false; return false; @@ -103,27 +103,27 @@ struct ObjectPosSelector return true; } - bool NextSmallStepAngle( float sign, UsedPosType uptype, float &angle ) + bool NextSmallStepAngle(float sign, UsedPosType uptype, float &angle) { // next possible angle angle = m_smallStepAngle[uptype] + m_anglestep * sign; - if(fabs(angle) > M_PI) + if (fabs(angle) > M_PI) { m_smallStepOk[uptype] = false; return false; } - if(m_smallStepNextUsedPos[uptype]) + if (m_smallStepNextUsedPos[uptype]) { - if(fabs(angle) >= m_smallStepNextUsedPos[uptype]->first) + if (fabs(angle) >= m_smallStepNextUsedPos[uptype]->first) { m_smallStepOk[uptype] = false; return false; } // if next node permit use selected angle, then do it - if(!CheckAngle(*m_smallStepNextUsedPos[uptype], sign, angle)) + if (!CheckAngle(*m_smallStepNextUsedPos[uptype], sign, angle)) { m_smallStepOk[uptype] = false; return false; diff --git a/src/game/Objects/Corpse.h b/src/game/Objects/Corpse.h index 72aaad7da..c1c28b027 100644 --- a/src/game/Objects/Corpse.h +++ b/src/game/Objects/Corpse.h @@ -53,14 +53,14 @@ enum CorpseFlags class Corpse : public WorldObject { public: - explicit Corpse( CorpseType type = CORPSE_BONES ); - ~Corpse( ) override; + explicit Corpse(CorpseType type = CORPSE_BONES); + ~Corpse() override; void AddToWorld() override; void RemoveFromWorld() override; - bool Create( uint32 guidlow ); - bool Create( uint32 guidlow, Player *owner ); + bool Create(uint32 guidlow); + bool Create(uint32 guidlow, Player *owner); void SaveToDB(); bool LoadFromDB(uint32 guid, Field *fields); diff --git a/src/game/Objects/Creature.h b/src/game/Objects/Creature.h index 971ec6e49..0352e1977 100644 --- a/src/game/Objects/Creature.h +++ b/src/game/Objects/Creature.h @@ -73,7 +73,7 @@ enum CreatureFlagsExtra }; // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack(1) #else #pragma pack(push,1) @@ -256,7 +256,7 @@ struct CreatureModelInfo }; // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack() #else #pragma pack(pop) @@ -350,16 +350,16 @@ struct VendorItemData VendorItem* GetItem(uint32 slot) const { - if(slot>=m_items.size()) return nullptr; + if (slot>=m_items.size()) return nullptr; return m_items[slot]; } bool Empty() const { return m_items.empty(); } uint8 GetItemCount() const { return m_items.size(); } - void AddItem( uint32 item, uint32 maxcount, uint32 ptime, uint32 itemflags) + void AddItem(uint32 item, uint32 maxcount, uint32 ptime, uint32 itemflags) { m_items.push_back(new VendorItem(item, maxcount, ptime, itemflags)); } - bool RemoveItem( uint32 item_id ); + bool RemoveItem(uint32 item_id); VendorItem const* FindItem(uint32 item_id) const; size_t FindItemSlot(uint32 item_id) const; @@ -591,7 +591,7 @@ class MANGOS_DLL_SPEC Creature : public Unit bool IsElite() const { - if(IsPet()) + if (IsPet()) return false; uint32 rank = GetCreatureInfo()->rank; @@ -600,7 +600,7 @@ class MANGOS_DLL_SPEC Creature : public Unit bool IsWorldBoss() const { - if(IsPet()) + if (IsPet()) return false; return GetCreatureInfo()->rank == CREATURE_ELITE_WORLDBOSS; diff --git a/src/game/Objects/GameObject.cpp b/src/game/Objects/GameObject.cpp index 97590cf76..e5b870fe4 100644 --- a/src/game/Objects/GameObject.cpp +++ b/src/game/Objects/GameObject.cpp @@ -148,7 +148,7 @@ void GameObject::RemoveFromWorld() Object::RemoveFromWorld(); } -bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state) +bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state) { MANGOS_ASSERT(map); Relocate(x, y, z, ang); @@ -365,7 +365,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/) return; } - const LockEntry *lock = sLockStore.LookupEntry(GetGOInfo()->GetLockId()); + LockEntry const* lock = sLockStore.LookupEntry(GetGOInfo()->GetLockId()); //workarounds for PvP banners if (lock && lock->Index[1] == LOCKTYPE_SLOW_OPEN) { @@ -469,7 +469,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/) { //BattleGround gameobjects case if (((Player*)ok)->InBattleGround()) - if (BattleGround *bg = ((Player*)ok)->GetBattleGround()) + if (BattleGround* bg = ((Player*)ok)->GetBattleGround()) bg->HandleTriggerBuff(GetObjectGuid()); } @@ -667,7 +667,7 @@ void GameObject::AddUniqueUse(Player* player) info->summoningRitual.animSpell && GetOwnerGuid() != player->GetObjectGuid()) { - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(info->summoningRitual.animSpell); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(info->summoningRitual.animSpell); if (!spellInfo) { sLog.outError("WORLD: unknown spell id %u at play anim for gameobject (Entry: %u GoType: %u )", info->summoningRitual.animSpell, GetEntry(), GetGoType()); @@ -779,7 +779,7 @@ void GameObject::Delete() sPoolMgr.GetPoolGameObjects(poolid).DespawnObject(*GetMap()->GetPersistentState(), GetGUIDLow()); } -void GameObject::getFishLoot(Loot *fishloot, Player* loot_owner) +void GameObject::getFishLoot(Loot* fishloot, Player* loot_owner) { fishloot->clear(); @@ -800,7 +800,7 @@ void GameObject::SaveToDB() { // this should only be used when the gameobject has already been loaded // preferably after adding to map, because mapid may not be valid otherwise - GameObjectData const *data = sObjectMgr.GetGOData(GetGUIDLow()); + GameObjectData const* data = sObjectMgr.GetGOData(GetGUIDLow()); if (!data) { sLog.outError("GameObject::SaveToDB failed, cannot get gameobject data!"); @@ -812,7 +812,7 @@ void GameObject::SaveToDB() void GameObject::SaveToDB(uint32 mapid) { - const GameObjectInfo *goI = GetGOInfo(); + GameObjectInfo const* goI = GetGOInfo(); if (!goI) return; @@ -866,7 +866,7 @@ void GameObject::SaveToDB(uint32 mapid) WorldDatabase.CommitTransaction(); } -bool GameObject::LoadFromDB(uint32 guid, Map *map) +bool GameObject::LoadFromDB(uint32 guid, Map* map) { GameObjectData const* data = sObjectMgr.GetGOData(guid); @@ -964,7 +964,7 @@ void GameObject::DeleteFromDB() const WorldDatabase.PExecuteLog("DELETE FROM gameobject_battleground WHERE guid = '%u'", GetGUIDLow()); } -GameObjectInfo const *GameObject::GetGOInfo() const +GameObjectInfo const* GameObject::GetGOInfo() const { return m_goInfo; } @@ -997,7 +997,7 @@ bool GameObject::HasInvolvedQuest(uint32 quest_id) const bool GameObject::IsTransport() const { // If something is marked as a transport, don't transmit an out of range packet for it. - GameObjectInfo const * gInfo = GetGOInfo(); + GameObjectInfo const* gInfo = GetGOInfo(); if (!gInfo) return false; return gInfo->type == GAMEOBJECT_TYPE_TRANSPORT || gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT; } @@ -1045,9 +1045,9 @@ bool GameObject::IsVisibleForInState(WorldObject const* pDetector, WorldObject c // special invisibility cases /* TODO: implement trap stealth, take look at spell 2836 - if(GetGOInfo()->type == GAMEOBJECT_TYPE_TRAP && GetGOInfo()->trap.stealthed && u->IsHostileTo(GetOwner())) + if (GetGOInfo()->type == GAMEOBJECT_TYPE_TRAP && GetGOInfo()->trap.stealthed && u->IsHostileTo(GetOwner())) { - if(check stuff here) + if (check stuff here) return false; }*/ if (Unit const* pDetectorUnit = pDetector->ToUnit()) @@ -1078,7 +1078,7 @@ void GameObject::Respawn() } } -bool GameObject::ActivateToQuest(Player *pTarget) const +bool GameObject::ActivateToQuest(Player* pTarget) const { // if GO is ReqCreatureOrGoN for quest if (pTarget->HasQuestForGO(GetEntry())) @@ -1124,7 +1124,7 @@ bool GameObject::ActivateToQuest(Player *pTarget) const { //look for battlegroundAV for some objects which are only activated after mine gots captured by own team // if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S) -// if (BattleGround *bg = pTarget->GetBattleGround()) +// if (BattleGround* bg = pTarget->GetBattleGround()) // if (bg->GetTypeID() == BATTLEGROUND_AV && !(((BattleGroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam()))) // return false; return true; @@ -1751,19 +1751,19 @@ void GameObject::Use(Unit* user) Unit* caster = GetOwner(); if (!caster) { - if( m_playerGroupId == 0) + if (m_playerGroupId == 0) return; - Group * group = ((Player*) user)->GetGroup(); - if(!group) + Group* group = ((Player*) user)->GetGroup(); + if (!group) return; - if(group->GetId() != m_playerGroupId) + if (group->GetId() != m_playerGroupId) return; } else { - if(caster->GetTypeId() != TYPEID_PLAYER) + if (caster->GetTypeId() != TYPEID_PLAYER) return; if (user->GetTypeId() != TYPEID_PLAYER || !((Player*)user)->IsInSameRaidWith((Player*)caster)) @@ -1792,7 +1792,7 @@ void GameObject::Use(Unit* user) if (player->CanUseBattleGroundObject()) { // in battleground check - BattleGround *bg = player->GetBattleGround(); + BattleGround* bg = player->GetBattleGround(); if (!bg) return; // BG flag click @@ -1829,7 +1829,7 @@ void GameObject::Use(Unit* user) if (player->CanUseBattleGroundObject()) { // in battleground check - BattleGround *bg = player->GetBattleGround(); + BattleGround* bg = player->GetBattleGround(); if (!bg) return; // BG flag dropped @@ -1941,7 +1941,7 @@ void GameObject::Use(Unit* user) if (!spellId) return; - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spellId); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(spellId); if (!spellInfo) { sLog.outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u )", spellId, GetEntry(), GetGoType()); @@ -1952,7 +1952,7 @@ void GameObject::Use(Unit* user) // Ensure that the spell you are using, and any event it may trigger, is checking // pointer validity (i.e. instance, GO, etc) since the caster may have moved maps // or the GO might be gone by the time the spell is executed. - Spell *spell = nullptr; + Spell* spell = nullptr; if (Unit* pUnit = spellCaster->ToUnit()) spell = new Spell(pUnit, spellInfo, triggered, GetObjectGuid()); else if (GameObject* pGo = spellCaster->ToGameObject()) @@ -1986,7 +1986,7 @@ const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const { if (loc_idx >= 0) { - GameObjectLocale const *cl = sObjectMgr.GetGameObjectLocale(GetEntry()); + GameObjectLocale const* cl = sObjectMgr.GetGameObjectLocale(GetEntry()); if (cl) { if (cl->Name.size() > (size_t)loc_idx && !cl->Name[loc_idx].empty()) @@ -2159,7 +2159,7 @@ bool GameObject::PlayerCanUse(Player* pl) uint32 lockId = inf->GetLockId(); if (lockId != 0) { - LockEntry const *lockInfo = sLockStore.LookupEntry(lockId); + LockEntry const* lockInfo = sLockStore.LookupEntry(lockId); if (!lockInfo) return false; for (int j = 0; j < 8; ++j) @@ -2322,7 +2322,7 @@ void GameObject::UpdateModelPosition() } } -GameObjectData const * GameObject::GetGOData() const +GameObjectData const* GameObject::GetGOData() const { return sObjectMgr.GetGOData(GetGUIDLow()); } diff --git a/src/game/Objects/GameObject.h b/src/game/Objects/GameObject.h index 8bc0a202c..c7256fee6 100644 --- a/src/game/Objects/GameObject.h +++ b/src/game/Objects/GameObject.h @@ -31,7 +31,7 @@ #include "Util.h" // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack(1) #else #pragma pack(push,1) @@ -43,7 +43,7 @@ struct GameObjectInfo uint32 id; uint32 type; uint32 displayId; - char *name; + char * name; uint32 faction; uint32 flags; float size; @@ -507,7 +507,7 @@ struct GameObjectInfo }; // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack() #else #pragma pack(pop) @@ -586,7 +586,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject void AddToWorld() override; void RemoveFromWorld() override; - bool Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state); + bool Create(uint32 guidlow, uint32 name_id, Map* map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state); void Update(uint32 update_diff, uint32 p_time) override; GameObjectInfo const* GetGOInfo() const; @@ -602,7 +602,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject void SaveToDB(); void SaveToDB(uint32 mapid); - bool LoadFromDB(uint32 guid, Map *map); + bool LoadFromDB(uint32 guid, Map* map); void DeleteFromDB() const; void SetOwnerGuid(ObjectGuid ownerGuid) @@ -625,7 +625,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject time_t GetRespawnTimeEx() const { time_t now = time(nullptr); - if(m_respawnTime > now) + if (m_respawnTime > now) return m_respawnTime; else return now; @@ -661,7 +661,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject static void AddToRemoveListInMaps(uint32 db_guid, GameObjectData const* data); static void SpawnInMaps(uint32 db_guid, GameObjectData const* data); - void getFishLoot(Loot *loot, Player* loot_owner); + void getFishLoot(Loot* loot, Player* loot_owner); GameobjectTypes GetGoType() const { return GameobjectTypes(GetUInt32Value(GAMEOBJECT_TYPE_ID)); } void SetGoType(GameobjectTypes type) { SetUInt32Value(GAMEOBJECT_TYPE_ID, type); } GOState GetGoState() const { return GOState(GetUInt32Value(GAMEOBJECT_STATE)); } @@ -720,7 +720,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject bool HasQuest(uint32 quest_id) const override; bool HasInvolvedQuest(uint32 quest_id) const override; - bool ActivateToQuest(Player *pTarget) const; + bool ActivateToQuest(Player* pTarget) const; uint32 GetDefaultGossipMenuId() const override { return GetGOInfo()->GetGossipMenuId(); } void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false); // 0 = use `gameobject`.`spawntimesecs` @@ -751,7 +751,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject void UpdateModel(); // updates model in case displayId were changed GameObjectModel* m_model; void UpdateModelPosition(); - GameObjectData const * GetGOData() const; + GameObjectData const* GetGOData() const; // Transports system uint64 GetRotation() const { return m_rotation; } @@ -790,7 +790,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject uint64 m_rotation; GameObjectInfo const* m_goInfo; - GameObjectAI *i_AI; + GameObjectAI* i_AI; uint32 m_playerGroupId; private: diff --git a/src/game/Objects/ItemPrototype.h b/src/game/Objects/ItemPrototype.h index 9fe00f99d..4a26c4999 100644 --- a/src/game/Objects/ItemPrototype.h +++ b/src/game/Objects/ItemPrototype.h @@ -408,7 +408,7 @@ enum ItemExtraFlags }; // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack(1) #else #pragma pack(push,1) @@ -537,7 +537,7 @@ struct ItemPrototype }; // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform -#if defined( __GNUC__ ) +#if defined(__GNUC__) #pragma pack() #else #pragma pack(pop) diff --git a/src/game/Objects/Object.cpp b/src/game/Objects/Object.cpp index 11769315e..c2a3026af 100644 --- a/src/game/Objects/Object.cpp +++ b/src/game/Objects/Object.cpp @@ -258,7 +258,7 @@ void Object::SendForcedObjectUpdate() iter->second.Send(iter->first->GetSession()); } -void Object::BuildMovementUpdateBlock(UpdateData * data, uint8 flags) const +void Object::BuildMovementUpdateBlock(UpdateData* data, uint8 flags) const { ByteBuffer buf(500); @@ -270,7 +270,7 @@ void Object::BuildMovementUpdateBlock(UpdateData * data, uint8 flags) const data->AddUpdateBlock(buf); } -void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const +void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const { if (!target) return; @@ -297,12 +297,12 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) c // UPDATETYPE_CREATE_OBJECT2 for some gameobject types... if (isType(TYPEMASK_GAMEOBJECT)) { - GameObject *go = (GameObject*)this; + GameObject* go = (GameObject*)this; switch (go->GetGoType()) { case GAMEOBJECT_TYPE_BUTTON: { - const LockEntry *lock = sLockStore.LookupEntry(go->GetGOInfo()->GetLockId()); + LockEntry const* lock = sLockStore.LookupEntry(go->GetGOInfo()->GetLockId()); if (!lock || lock->Index[1] != LOCKTYPE_SLOW_OPEN || (go->isSpawned() && !go->GetRespawnDelay())) break; @@ -387,7 +387,7 @@ void WorldObject::DirectSendPublicValueUpdate(uint32 index) SendObjectMessageToSet(&packet, true); } -void Object::BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) const +void Object::BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const { ByteBuffer buf(500); @@ -407,7 +407,7 @@ void Object::BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) c data->AddUpdateBlock(buf); } -void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const +void Object::BuildOutOfRangeUpdateBlock(UpdateData* data) const { data->AddOutOfRangeGUID(GetObjectGuid()); } @@ -421,7 +421,7 @@ void Object::SendOutOfRangeUpdateToPlayer(Player* player) player->SendDirectMessage(&packet); } -void Object::DestroyForPlayer(Player *target) const +void Object::DestroyForPlayer(Player* target) const { MANGOS_ASSERT(target); @@ -430,7 +430,7 @@ void Object::DestroyForPlayer(Player *target) const target->GetSession()->SendPacket(&data); } -void Object::BuildMovementUpdate(ByteBuffer * data, uint8 updateFlags) const +void Object::BuildMovementUpdate(ByteBuffer* data, uint8 updateFlags) const { #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4 *data << uint8(updateFlags); // update flags @@ -574,7 +574,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint8 updateFlags) const #endif } -void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *updateMask, Player *target) const +void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* updateMask, Player* target) const { if (!target) return; @@ -699,10 +699,10 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask * { uint32 dynamicFlags = m_uint32Values[index]; if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TRACK_UNIT)) - if (Unit const * unit = ToUnit()) + if (Unit const* unit = ToUnit()) { Unit::AuraList auras = unit->GetAurasByType(SPELL_AURA_MOD_STALKED); - if (std::find_if(auras.begin(), auras.end(),[target](Aura *a){ + if (std::find_if(auras.begin(), auras.end(),[target](Aura* a){ return target->GetObjectGuid() == a->GetCasterGuid(); }) == auras.end()) dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT; @@ -737,7 +737,7 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask * bool forceFriendly = false; if (owner) { - FactionTemplateEntry const *ft1, *ft2; + FactionTemplateEntry const* ft1,* ft2; ft1 = owner->getFactionTemplateEntry(); ft2 = target->getFactionTemplateEntry(); if (ft1 && ft2 && !ft1->IsFriendlyTo(*ft2) && owner->IsInSameRaidWith(target)) @@ -933,7 +933,7 @@ void Object::_LoadIntoDataField(std::string const& data, uint32 startOffset, uin } } -void Object::_SetUpdateBits(UpdateMask *updateMask, Player* /*target*/) const +void Object::_SetUpdateBits(UpdateMask* updateMask, Player* /*target*/) const { for (uint16 index = 0; index < m_valuesCount; ++index) { @@ -942,7 +942,7 @@ void Object::_SetUpdateBits(UpdateMask *updateMask, Player* /*target*/) const } } -void Object::_SetCreateBits(UpdateMask *updateMask, Player* /*target*/) const +void Object::_SetCreateBits(UpdateMask* updateMask, Player* /*target*/) const { for (uint16 index = 0; index < m_valuesCount; ++index) { @@ -1258,7 +1258,7 @@ void Object::ExecuteDelayedActions() } } -bool WorldObject::IsWithinLootXPDist(WorldObject const * objToLoot) const +bool WorldObject::IsWithinLootXPDist(WorldObject const* objToLoot) const { if (objToLoot && IsInMap(objToLoot) && objToLoot->GetMap()->IsRaid()) return true; @@ -1883,7 +1883,7 @@ bool WorldObject::IsPositionValid() const return MaNGOS::IsValidMapCoord(m_position.x, m_position.y, m_position.z, m_position.o); } -void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/) const +void WorldObject::SendMessageToSet(WorldPacket* data, bool /*bToSelf*/) const { //if object is in world, map for it already created! if (IsInWorld()) @@ -1895,7 +1895,7 @@ struct MANGOS_DLL_DECL ObjectViewersDeliverer WorldPacket* i_message; WorldObject const* i_sender; WorldObject const* i_except; - explicit ObjectViewersDeliverer(WorldObject const* sender, WorldPacket *msg, WorldObject const* except) : i_message(msg), i_sender(sender), i_except(except) {} + explicit ObjectViewersDeliverer(WorldObject const* sender, WorldPacket* msg, WorldObject const* except) : i_message(msg), i_sender(sender), i_except(except) {} void Visit(CameraMapType &m) { for (auto iter = m.begin(); iter != m.end(); ++iter) @@ -1907,7 +1907,7 @@ struct MANGOS_DLL_DECL ObjectViewersDeliverer template void Visit(GridRefManager &) {} }; -void WorldObject::SendObjectMessageToSet(WorldPacket *data, bool self, WorldObject const* except) const +void WorldObject::SendObjectMessageToSet(WorldPacket* data, bool self, WorldObject const* except) const { if (self && this != except) if (Player const* me = ToPlayer()) @@ -1945,14 +1945,14 @@ void WorldObject::SendMovementMessageToSet(WorldPacket data, bool self, WorldObj } } -void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*bToSelf*/) const +void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*bToSelf*/) const { //if object is in world, map for it already created! if (IsInWorld()) GetMap()->MessageDistBroadcast(this, data, dist); } -void WorldObject::SendMessageToSetExcept(WorldPacket *data, Player const* skipped_receiver) const +void WorldObject::SendMessageToSetExcept(WorldPacket* data, Player const* skipped_receiver) const { //if object is in world, map for it already created! if (IsInWorld()) @@ -1996,7 +1996,7 @@ bool WorldObject::isWithinVisibilityDistanceOf(Unit const* viewer, WorldObject c return true; } -void WorldObject::SetMap(Map * map) +void WorldObject::SetMap(Map* map) { MANGOS_ASSERT(map); m_currMap = map; @@ -2035,7 +2035,7 @@ void WorldObject::AddObjectToRemoveList() _deleted = true; } -Creature *Map::SummonCreature(uint32 entry, float x, float y, float z, float ang, TempSummonType spwtype, uint32 despwtime, bool asActiveObject) +Creature* Map::SummonCreature(uint32 entry, float x, float y, float z, float ang, TempSummonType spwtype, uint32 despwtime, bool asActiveObject) { CreatureInfo const* pInf = sObjectMgr.GetCreatureTemplate(entry); if (!pInf) @@ -2069,7 +2069,7 @@ Creature *Map::SummonCreature(uint32 entry, float x, float y, float z, float ang Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, float ang, TempSummonType spwtype, uint32 despwtime, bool asActiveObject, uint32 pacifiedTimer, CreatureAiSetter pFuncAiSetter) { - CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(id); + CreatureInfo const* cinfo = ObjectMgr::GetCreatureTemplate(id); if (!cinfo) { sLog.outErrorDb("WorldObject::SummonCreature: Creature (Entry: %u) not existed for summoner: %s. ", id, GetGuidStr().c_str()); @@ -2155,8 +2155,8 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float sLog.outErrorDb("Gameobject template %u not found in database!", entry); return nullptr; } - Map *map = GetMap(); - GameObject *go = new GameObject(); + Map* map = GetMap(); + GameObject* go = new GameObject(); if (!go->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY)) { delete go; @@ -2570,7 +2570,7 @@ void WorldObject::DestroyForNearbyPlayers() Cell::VisitWorldObjects(this, searcher, GetMap()->GetVisibilityDistance() + GetVisibilityModifier()); for (std::list::const_iterator iter = targets.begin(); iter != targets.end(); ++iter) { - Player *plr = (*iter); + Player* plr = (*iter); if (plr == this) continue; @@ -3061,7 +3061,7 @@ void WorldObject::LoadMapCellsAround(float dist) const Cell::VisitAllObjects(this, notifier, dist, false); } -Unit* WorldObject::SelectMagnetTarget(Unit *victim, Spell* spell, SpellEffectIndex eff) +Unit* WorldObject::SelectMagnetTarget(Unit* victim, Spell* spell, SpellEffectIndex eff) { if (!victim) return nullptr; @@ -3085,7 +3085,7 @@ Unit* WorldObject::SelectMagnetTarget(Unit *victim, Spell* spell, SpellEffectInd { if (magnet->IsAlive() && magnet->IsWithinLOSInMap(this) && spell->CheckTarget(magnet, eff)) { - if (SpellAuraHolder *holder = (*itr)->GetHolder()) + if (SpellAuraHolder* holder = (*itr)->GetHolder()) if (holder->DropAuraCharge()) { magnet->RemoveAurasDueToSpell(holder->GetId()); // Remove from grounding totem also @@ -3408,7 +3408,7 @@ SpellMissInfo WorldObject::SpellHitResult(Unit* pVictim, SpellEntry const* spell return SPELL_MISS_NONE; } -void WorldObject::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellEntry const *procSpell, Spell* spell) +void WorldObject::ProcDamageAndSpell(Unit* pVictim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellEntry const* procSpell, Spell* spell) { if ((pVictim && !IsInMap(pVictim)) || !IsInWorld()) return; @@ -3465,7 +3465,7 @@ float WorldObject::MeleeSpellMissChance(Unit* pVictim, WeaponAttackType attType, if (Unit* pUnit = ToUnit()) { // Spellmod from SPELLMOD_RESIST_MISS_CHANCE - if (Player * modOwner = pUnit->GetSpellModOwner()) + if (Player* modOwner = pUnit->GetSpellModOwner()) modOwner->ApplySpellMod(spell->Id, SPELLMOD_RESIST_MISS_CHANCE, hitChance, spellPtr); // Bonuses from attacker aura and ratings @@ -3652,7 +3652,7 @@ int32 WorldObject::MagicSpellHitChance(Unit* pVictim, SpellEntry const* spell, S // Spellmod from SPELLMOD_RESIST_MISS_CHANCE if (Unit* pUnit = ToUnit()) { - if (Player * modOwner = pUnit->GetSpellModOwner()) + if (Player* modOwner = pUnit->GetSpellModOwner()) { modOwner->ApplySpellMod(spell->Id, SPELLMOD_RESIST_MISS_CHANCE, modHitChance, spellPtr); //DEBUG_UNIT(this, DEBUG_SPELL_COMPUTE_RESISTS, "SPELLMOD_RESIST_MISS_CHANCE : %f", modHitChance); @@ -3745,7 +3745,7 @@ float WorldObject::GetSpellResistChance(Unit const* victim, uint32 schoolMask, b return resistModHitChance; } -void WorldObject::SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo) +void WorldObject::SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo) { WorldPacket data(SMSG_SPELLLOGMISS, (4 + 8 + 1 + 4 + 8 + 1)); data << uint32(spellID); @@ -3760,7 +3760,7 @@ void WorldObject::SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo miss SendObjectMessageToSet(&data, true); } -uint32 WorldObject::SpellCriticalDamageBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim, Spell* spell) +uint32 WorldObject::SpellCriticalDamageBonus(SpellEntry const* spellProto, uint32 damage, Unit* pVictim, Spell* spell) { // Calculate critical bonus int32 crit_bonus; @@ -3797,7 +3797,7 @@ uint32 WorldObject::SpellCriticalDamageBonus(SpellEntry const *spellProto, uint3 return damage; } -uint32 WorldObject::SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 damage, Unit const* pVictim) const +uint32 WorldObject::SpellCriticalHealingBonus(SpellEntry const* spellProto, uint32 damage, Unit const* pVictim) const { // Calculate critical bonus int32 crit_bonus; @@ -3828,7 +3828,7 @@ uint32 WorldObject::SpellCriticalHealingBonus(SpellEntry const *spellProto, uint return damage; } -int32 WorldObject::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellProto, bool critical) +int32 WorldObject::DealHeal(Unit* pVictim, uint32 addhealth, SpellEntry const* spellProto, bool critical) { Unit* pUnit = ToUnit(); @@ -3864,7 +3864,7 @@ void WorldObject::SendHealSpellLog(Unit const* pVictim, uint32 SpellID, uint32 D #endif } -void WorldObject::EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype) +void WorldObject::EnergizeBySpell(Unit* pVictim, uint32 SpellID, uint32 Damage, Powers powertype) { SendEnergizeSpellLog(pVictim, SpellID, Damage, powertype); // needs to be called after sending spell log @@ -3884,7 +3884,7 @@ void WorldObject::SendEnergizeSpellLog(Unit const* pVictim, uint32 SpellID, uint #endif } -void WorldObject::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log) +void WorldObject::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage* log) { WorldPacket data(SMSG_SPELLNONMELEEDAMAGELOG, (16 + 4 + 4 + 1 + 4 + 4 + 1 + 1 + 4 + 4 + 1)); // we guess size #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4 @@ -4021,10 +4021,10 @@ int32 WorldObject::CalculateSpellDamage(Unit const* target, SpellEntry const* sp return value; } -void WorldObject::CalculateSpellDamage(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType, Spell* spell) +void WorldObject::CalculateSpellDamage(SpellNonMeleeDamage* damageInfo, int32 damage, SpellEntry const* spellInfo, WeaponAttackType attackType, Spell* spell) { SpellSchoolMask damageSchoolMask = GetSchoolMask(damageInfo->school); - Unit *pVictim = damageInfo->target; + Unit* pVictim = damageInfo->target; if (!pVictim) return; @@ -4100,7 +4100,7 @@ uint32 WorldObject::MeleeDamageBonusDone(Unit* pVictim, uint32 pdamage, WeaponAt // differentiate for weapon damage based spells bool isWeaponDamageBasedSpell = !(spellProto && (damagetype == DOT || spellProto->HasEffect(SPELL_EFFECT_SCHOOL_DAMAGE))); - Item* pWeapon = GetTypeId() == TYPEID_PLAYER ? ((Player*)this)->GetWeaponForAttack(attType, true, false) : nullptr; + Item* pWeapon = GetTypeId() == TYPEID_PLAYER ? ((Player*)this)->GetWeaponForAttack(attType, true, false) : nullptr; uint32 creatureTypeMask = pVictim->GetCreatureTypeMask(); uint32 schoolMask = spellProto ? spellProto->GetSpellSchoolMask() : GetMeleeDamageSchoolMask(); @@ -4248,7 +4248,7 @@ uint32 WorldObject::MeleeDamageBonusDone(Unit* pVictim, uint32 pdamage, WeaponAt * Calculates caster part of healing spell bonuses, * also includes different bonuses dependent from target auras */ -uint32 WorldObject::SpellHealingBonusDone(Unit *pVictim, SpellEntry const *spellProto, int32 healamount, DamageEffectType damagetype, uint32 stack, Spell* spell) +uint32 WorldObject::SpellHealingBonusDone(Unit* pVictim, SpellEntry const* spellProto, int32 healamount, DamageEffectType damagetype, uint32 stack, Spell* spell) { Unit* pUnit = ToUnit(); @@ -4276,7 +4276,7 @@ uint32 WorldObject::SpellHealingBonusDone(Unit *pVictim, SpellEntry const *spell DoneTotalMod *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f; // done scripted mod (take it from owner) - Unit *owner = pUnit->GetOwner(); + Unit* owner = pUnit->GetOwner(); if (!owner) owner = pUnit; @@ -4351,7 +4351,7 @@ int32 WorldObject::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) * Calculates caster part of spell damage bonuses, * also includes different bonuses dependent from target auras */ -uint32 WorldObject::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack, Spell* spell) +uint32 WorldObject::SpellDamageBonusDone(Unit* pVictim, SpellEntry const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack, Spell* spell) { if (!spellProto || !pVictim || damagetype == DIRECT_DAMAGE) return pdamage; @@ -4374,7 +4374,7 @@ uint32 WorldObject::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellP float DoneTotalMod = 1.0f; int32 DoneTotal = 0; - Item* pWeapon = GetTypeId() == TYPEID_PLAYER ? ((Player*)this)->GetWeaponForAttack(BASE_ATTACK, true, false) : nullptr; + Item* pWeapon = GetTypeId() == TYPEID_PLAYER ? ((Player*)this)->GetWeaponForAttack(BASE_ATTACK, true, false) : nullptr; // Creature damage if (GetTypeId() == TYPEID_UNIT && !((Creature*)this)->IsPet()) @@ -4416,7 +4416,7 @@ uint32 WorldObject::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellP DoneTotal += pUnit->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE, creatureTypeMask); // done scripted mod (take it from owner) - Unit *owner = pUnit ? pUnit->GetOwner() : nullptr; + Unit* owner = pUnit ? pUnit->GetOwner() : nullptr; if (!owner) owner = pUnit; if (owner) { @@ -4513,7 +4513,7 @@ int32 WorldObject::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) return DoneAdvertisedBenefit; } -int32 WorldObject::SpellBonusWithCoeffs(SpellEntry const *spellProto, int32 total, int32 benefit, int32 ap_benefit, DamageEffectType damagetype, bool donePart, WorldObject* pCaster, Spell* spell) const +int32 WorldObject::SpellBonusWithCoeffs(SpellEntry const* spellProto, int32 total, int32 benefit, int32 ap_benefit, DamageEffectType damagetype, bool donePart, WorldObject* pCaster, Spell* spell) const { // Distribute Damage over multiple effects, reduce by AoE float coeff = 0.0f; @@ -4585,7 +4585,7 @@ int32 WorldObject::SpellBonusWithCoeffs(SpellEntry const *spellProto, int32 tota return total; }; -void WorldObject::DealDamageMods(Unit *victim, uint32 &damage, uint32* absorb) +void WorldObject::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb) { Unit* pUnit = ToUnit(); // [Nostalrius] Pas de degats sous esprit de redemption @@ -4627,10 +4627,10 @@ float WorldObject::CalculateLevelPenalty(SpellEntry const* spellProto) /* float LvlPenalty = 0.0f; - if(spellLevel < 20) + if (spellLevel < 20) LvlPenalty = 20.0f - spellLevel * 3.75f; float LvlFactor = (float(spellLevel) + 6.0f) / float(GetLevel()); - if(LvlFactor > 1.0f) + if (LvlFactor > 1.0f) LvlFactor = 1.0f; return (100.0f - LvlPenalty) * LvlFactor / 100.0f; @@ -4646,7 +4646,7 @@ float WorldObject::GetAPMultiplier(WeaponAttackType attType, bool normalized) co if (!normalized || GetTypeId() != TYPEID_PLAYER) return float(pUnit->GetAttackTime(attType)) / 1000.0f; - Item *Weapon = ((Player*)this)->GetWeaponForAttack(attType, true, false); + Item* Weapon = ((Player*)this)->GetWeaponForAttack(attType, true, false); if (!Weapon) return 2.4f; // fist attack @@ -4666,12 +4666,12 @@ float WorldObject::GetAPMultiplier(WeaponAttackType attType, bool normalized) co } } -void WorldObject::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss) +void WorldObject::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss) { if (!damageInfo) return; - Unit *pVictim = damageInfo->target; + Unit* pVictim = damageInfo->target; if (!pVictim) return; @@ -4679,7 +4679,7 @@ void WorldObject::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabili if (!pVictim->IsAlive() || pVictim->IsTaxiFlying() || (pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())) return; - SpellEntry const *spellProto = sSpellMgr.GetSpellEntry(damageInfo->SpellID); + SpellEntry const* spellProto = sSpellMgr.GetSpellEntry(damageInfo->SpellID); if (spellProto == nullptr) { sLog.outError("WorldObject::DealSpellDamage have wrong damageInfo->SpellID: %u", damageInfo->SpellID); @@ -4691,7 +4691,7 @@ void WorldObject::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabili DealDamage(pVictim, damageInfo->damage, &cleanDamage, SPELL_DIRECT_DAMAGE, GetSchoolMask(damageInfo->school), spellProto, durabilityLoss, damageInfo->spell); } -uint32 WorldObject::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const *spellProto, bool durabilityLoss, Spell* spell) +uint32 WorldObject::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const* spellProto, bool durabilityLoss, Spell* spell) { // Should never happen since DealDamage is overriden in Unit class. if (pVictim == this) @@ -4711,7 +4711,7 @@ bool WorldObject::CheckAndIncreaseCastCounter() return true; } -void WorldObject::SetCurrentCastedSpell(Spell * pSpell) +void WorldObject::SetCurrentCastedSpell(Spell* pSpell) { MANGOS_ASSERT(pSpell); // nullptr may be never passed here, use InterruptSpell or InterruptNonMeleeSpells @@ -4921,7 +4921,7 @@ void WorldObject::GetDynObjects(uint32 spellId, SpellEffectIndex effectIndex, st } } -DynamicObject * WorldObject::GetDynObject(uint32 spellId, SpellEffectIndex effIndex) +DynamicObject* WorldObject::GetDynObject(uint32 spellId, SpellEffectIndex effIndex) { for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();) { @@ -4939,7 +4939,7 @@ DynamicObject * WorldObject::GetDynObject(uint32 spellId, SpellEffectIndex effIn return nullptr; } -DynamicObject * WorldObject::GetDynObject(uint32 spellId) +DynamicObject* WorldObject::GetDynObject(uint32 spellId) { for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();) { @@ -4992,9 +4992,9 @@ void WorldObject::RemoveAllDynObjects() } } -void WorldObject::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy, SpellEntry const* triggeredByParent) +void WorldObject::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item* castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy, SpellEntry const* triggeredByParent) { - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spellId); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(spellId); if (!spellInfo) { @@ -5008,7 +5008,7 @@ void WorldObject::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item * CastSpell(Victim, spellInfo, triggered, castItem, triggeredByAura, originalCaster, triggeredBy, triggeredByParent); } -void WorldObject::CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy, SpellEntry const* triggeredByParent) +void WorldObject::CastSpell(Unit* Victim, SpellEntry const* spellInfo, bool triggered, Item* castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy, SpellEntry const* triggeredByParent) { if (!spellInfo) { @@ -5030,7 +5030,7 @@ void WorldObject::CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool trig triggeredBy = triggeredByAura->GetSpellProto(); } - Spell *spell; + Spell* spell; if (Unit* pUnit = ToUnit()) spell = new Spell(pUnit, spellInfo, triggered, originalCaster, triggeredBy, nullptr, triggeredByParent); @@ -5056,9 +5056,9 @@ void WorldObject::CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool trig spell->prepare(std::move(targets), triggeredByAura); } -void WorldObject::CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy) +void WorldObject::CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy) { - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spellId); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(spellId); if (!spellInfo) { @@ -5072,7 +5072,7 @@ void WorldObject::CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0 CastCustomSpell(Victim, spellInfo, bp0, bp1, bp2, triggered, castItem, triggeredByAura, originalCaster, triggeredBy); } -void WorldObject::CastCustomSpell(Unit* Victim, SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy) +void WorldObject::CastCustomSpell(Unit* Victim, SpellEntry const* spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy) { if (!spellInfo) { @@ -5094,7 +5094,7 @@ void WorldObject::CastCustomSpell(Unit* Victim, SpellEntry const *spellInfo, int triggeredBy = triggeredByAura->GetSpellProto(); } - Spell *spell; + Spell* spell; if (Unit* pUnit = ToUnit()) spell = new Spell(pUnit, spellInfo, triggered, originalCaster, triggeredBy); @@ -5119,9 +5119,9 @@ void WorldObject::CastCustomSpell(Unit* Victim, SpellEntry const *spellInfo, int } // used for scripting -void WorldObject::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy) +void WorldObject::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy) { - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spellId); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(spellId); if (!spellInfo) { @@ -5136,7 +5136,7 @@ void WorldObject::CastSpell(float x, float y, float z, uint32 spellId, bool trig } // used for scripting -void WorldObject::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy) +void WorldObject::CastSpell(float x, float y, float z, SpellEntry const* spellInfo, bool triggered, Item* castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy) { if (!spellInfo) { @@ -5158,7 +5158,7 @@ void WorldObject::CastSpell(float x, float y, float z, SpellEntry const *spellIn triggeredBy = triggeredByAura->GetSpellProto(); } - Spell *spell; + Spell* spell; if (Unit* pUnit = ToUnit()) spell = new Spell(pUnit, spellInfo, triggered, originalCaster, triggeredBy); diff --git a/src/game/Objects/Object.h b/src/game/Objects/Object.h index 23d96718b..855c4805f 100644 --- a/src/game/Objects/Object.h +++ b/src/game/Objects/Object.h @@ -132,7 +132,7 @@ class WorldUpdateCounter uint32 timeElapsed() { - if(!m_tmStart) + if (!m_tmStart) m_tmStart = WorldTimer::tickPrevTime(); return WorldTimer::getMSTimeDiff(m_tmStart, WorldTimer::tickTime()); @@ -239,7 +239,7 @@ class MovementInfo void SetMovementFlags(MovementFlags f) { moveFlags = f; } // Position manipulations - Position const *GetPos() const { return &pos; } + Position const* GetPos() const { return &pos; } void SetTransportData(ObjectGuid guid, float x, float y, float z, float o, uint32 time) { t_guid = guid; @@ -259,7 +259,7 @@ class MovementInfo t_time = 0; } ObjectGuid const& GetTransportGuid() const { return t_guid; } - Position const *GetTransportPos() const { return &t_pos; } + Position const* GetTransportPos() const { return &t_pos; } Position* GetTransportPos() { return &t_pos; } uint32 GetTransportTime() const { return t_time; } uint32 GetFallTime() const { return fallTime; } @@ -325,7 +325,7 @@ class MANGOS_DLL_SPEC Object const bool& IsInWorld() const { return m_inWorld; } virtual void AddToWorld() { - if(m_inWorld) + if (m_inWorld) return; m_inWorld = true; @@ -359,7 +359,7 @@ class MANGOS_DLL_SPEC Object uint8 GetTypeId() const { return m_objectTypeId; } bool isType(TypeMask mask) const { return (mask & m_objectType); } - virtual void BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const; + virtual void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const; void SendCreateUpdateToPlayer(Player* player); // must be overwrite in appropriate subclasses (WorldObject, Item currently), or will crash @@ -371,17 +371,17 @@ class MANGOS_DLL_SPEC Object void AddDelayedAction(ObjectDelayedAction e) { _delayedActions |= e; } void ExecuteDelayedActions(); - void BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) const; - void BuildOutOfRangeUpdateBlock(UpdateData *data) const; - void BuildMovementUpdateBlock(UpdateData * data, uint8 flags = 0) const; + void BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const; + void BuildOutOfRangeUpdateBlock(UpdateData* data) const; + void BuildMovementUpdateBlock(UpdateData* data, uint8 flags = 0) const; - void BuildMovementUpdate(ByteBuffer * data, uint8 updateFlags) const; - void BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, UpdateMask *updateMask, Player *target) const; + void BuildMovementUpdate(ByteBuffer* data, uint8 updateFlags) const; + void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* updateMask, Player* target) const; void BuildUpdateDataForPlayer(Player* pl, UpdateDataMapType& update_players); void SendOutOfRangeUpdateToPlayer(Player* player); - virtual void DestroyForPlayer(Player *target) const; + virtual void DestroyForPlayer(Player* target) const; const int32& GetInt32Value(uint16 index) const { @@ -452,7 +452,7 @@ class MANGOS_DLL_SPEC Object void ToggleFlag(uint16 index, uint32 flag) { - if(HasFlag(index, flag)) + if (HasFlag(index, flag)) RemoveFlag(index, flag); else SetFlag(index, flag); @@ -608,10 +608,10 @@ class MANGOS_DLL_SPEC Object void _InitValues(); void _Create (uint32 guidlow, uint32 entry, HighGuid guidhigh); - virtual void _SetUpdateBits(UpdateMask *updateMask, Player *target) const; + virtual void _SetUpdateBits(UpdateMask* updateMask, Player* target) const; void _LoadIntoDataField(std::string const& data, uint32 startOffset, uint32 count); - virtual void _SetCreateBits(UpdateMask *updateMask, Player *target) const; + virtual void _SetCreateBits(UpdateMask* updateMask, Player* target) const; uint16 m_objectType; @@ -620,12 +620,12 @@ class MANGOS_DLL_SPEC Object union { - int32 *m_int32Values; - uint32 *m_uint32Values; - float *m_floatValues; + int32* m_int32Values; + uint32* m_uint32Values; + float* m_floatValues; }; - uint32 *m_uint32Values_mirror; + uint32* m_uint32Values_mirror; uint16 m_valuesCount; @@ -663,13 +663,13 @@ enum MeleeHitOutcome // Spell damage info structure based on structure sending in SMSG_SPELLNONMELEEDAMAGELOG opcode struct SpellNonMeleeDamage { - SpellNonMeleeDamage(WorldObject *_attacker, Unit *_target, uint32 _SpellID, SpellSchools _school) + SpellNonMeleeDamage(WorldObject* _attacker, Unit* _target, uint32 _SpellID, SpellSchools _school) : target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), school(_school), absorb(0), resist(0), periodicLog(false), unused(false), blocked(0), HitInfo(0), spell(nullptr) {} - Unit *target; - WorldObject *attacker; + Unit* target; + WorldObject* attacker; uint32 SpellID; uint32 damage; SpellSchools school; @@ -679,7 +679,7 @@ struct SpellNonMeleeDamage { bool unused; uint32 blocked; uint32 HitInfo; - Spell *spell; + Spell* spell; }; struct CleanDamage @@ -716,7 +716,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object class MANGOS_DLL_SPEC UpdateHelper { public: - explicit UpdateHelper(WorldObject * obj) : m_obj(obj) {} + explicit UpdateHelper(WorldObject* obj) : m_obj(obj) {} ~UpdateHelper() { } void Update(uint32 time_diff) @@ -735,7 +735,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object UpdateHelper(const UpdateHelper&); UpdateHelper& operator=(const UpdateHelper&) = delete; - WorldObject * const m_obj; + WorldObject* const m_obj; }; ~WorldObject () override {} @@ -863,7 +863,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object // Transports / Movement Transport* GetTransport() const { return m_transport; } - virtual void SetTransport(Transport * t) { m_transport = t; } + virtual void SetTransport(Transport* t) { m_transport = t; } float GetTransOffsetX() const { return m_movementInfo.GetTransportPos()->x; } float GetTransOffsetY() const { return m_movementInfo.GetTransportPos()->y; } @@ -886,18 +886,18 @@ class MANGOS_DLL_SPEC WorldObject : public Object bool IsMovingButNotWalking() const { return IsMoving() && !(IsWalking() || IsWalkingBackward()); } MovementInfo m_movementInfo; - Transport * m_transport; + Transport* m_transport; virtual void CleanupsBeforeDelete(); // used in destructor or explicitly before mass creature delete to remove cross-references to already deleted units // Send to players - virtual void SendMessageToSet(WorldPacket *data, bool self) const; + virtual void SendMessageToSet(WorldPacket* data, bool self) const; // Send to players who have object at client - void SendObjectMessageToSet(WorldPacket *data, bool self, WorldObject const* except = nullptr) const; + void SendObjectMessageToSet(WorldPacket* data, bool self, WorldObject const* except = nullptr) const; void SendMovementMessageToSet(WorldPacket data, bool self, WorldObject const* except = nullptr); - virtual void SendMessageToSetInRange(WorldPacket *data, float dist, bool self) const; - void SendMessageToSetExcept(WorldPacket *data, Player const* skipped_receiver) const; + virtual void SendMessageToSetInRange(WorldPacket* data, float dist, bool self) const; + void SendMessageToSetExcept(WorldPacket* data, Player const* skipped_receiver) const; void DirectSendPublicValueUpdate(uint32 index); void PlayDistanceSound(uint32 sound_id, Player const* target = nullptr) const; @@ -949,9 +949,9 @@ class MANGOS_DLL_SPEC WorldObject : public Object // low level function for visibility change code, must be define in all main world object subclasses virtual bool IsVisibleForInState(WorldObject const* pDetector, WorldObject const* viewPoint, bool inVisibleList) const = 0; - void SetMap(Map * map); - Map * GetMap() const; - Map * FindMap() const { return m_currMap; } + void SetMap(Map* map); + Map* GetMap() const; + Map* FindMap() const { return m_currMap; } //used to check all object's GetMap() calls when object is not in world! void ResetMap(); @@ -1020,16 +1020,16 @@ class MANGOS_DLL_SPEC WorldObject : public Object uint32 GetDefenseSkillValue(WorldObject const* target = nullptr) const; virtual Player* GetAffectingPlayer() const { return nullptr; } - Unit* SelectMagnetTarget(Unit *victim, Spell* spell = nullptr, SpellEffectIndex eff = EFFECT_INDEX_0); + Unit* SelectMagnetTarget(Unit* victim, Spell* spell = nullptr, SpellEffectIndex eff = EFFECT_INDEX_0); - void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr, SpellEntry const* triggeredByParent = nullptr); - void CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool triggered, Item *castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr, SpellEntry const* triggeredByParent = nullptr); - void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr); - void CastCustomSpell(Unit* Victim, SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr); - void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr); - void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr); + void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item* castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr, SpellEntry const* triggeredByParent = nullptr); + void CastSpell(Unit* Victim, SpellEntry const* spellInfo, bool triggered, Item* castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr, SpellEntry const* triggeredByParent = nullptr); + void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr); + void CastCustomSpell(Unit* Victim, SpellEntry const* spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr); + void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr); + void CastSpell(float x, float y, float z, SpellEntry const* spellInfo, bool triggered, Item* castItem = nullptr, Aura* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = nullptr); - void SetCurrentCastedSpell(Spell * pSpell); + void SetCurrentCastedSpell(Spell* pSpell); Spell* GetCurrentSpell(CurrentSpellTypes spellType) const { return m_currentSpells[spellType]; } Spell* FindCurrentSpellBySpellId(uint32 spell_id) const; bool CheckAndIncreaseCastCounter(); @@ -1052,35 +1052,35 @@ class MANGOS_DLL_SPEC WorldObject : public Object virtual bool IsSpellCrit(Unit const* pVictim, SpellEntry const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK, Spell* spell = nullptr) const { return false; } uint32 SpellCriticalHealingBonus(SpellEntry const* spellProto, uint32 damage, Unit const* pVictim) const; - uint32 SpellCriticalDamageBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim, Spell* spell = nullptr); - float MeleeSpellMissChance(Unit *pVictim, WeaponAttackType attType, int32 skillDiff, SpellEntry const *spell, Spell* spellPtr = nullptr); - SpellMissInfo MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell, Spell* spellPtr = nullptr); - SpellMissInfo MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell, Spell* spellPtr = nullptr); - int32 MagicSpellHitChance(Unit *pVictim, SpellEntry const *spell, Spell* spellPtr = nullptr); + uint32 SpellCriticalDamageBonus(SpellEntry const* spellProto, uint32 damage, Unit* pVictim, Spell* spell = nullptr); + float MeleeSpellMissChance(Unit* pVictim, WeaponAttackType attType, int32 skillDiff, SpellEntry const* spell, Spell* spellPtr = nullptr); + SpellMissInfo MeleeSpellHitResult(Unit* pVictim, SpellEntry const* spell, Spell* spellPtr = nullptr); + SpellMissInfo MagicSpellHitResult(Unit* pVictim, SpellEntry const* spell, Spell* spellPtr = nullptr); + int32 MagicSpellHitChance(Unit* pVictim, SpellEntry const* spell, Spell* spellPtr = nullptr); float GetSpellResistChance(Unit const* victim, uint32 schoolMask, bool innateResists) const; - SpellMissInfo SpellHitResult(Unit *pVictim, SpellEntry const *spell, SpellEffectIndex effIndex, bool canReflect = false, Spell* spellPtr = nullptr); - void ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellEntry const *procSpell = nullptr, Spell* spell = nullptr); - void CalculateSpellDamage(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType = BASE_ATTACK, Spell* spell = nullptr); + SpellMissInfo SpellHitResult(Unit* pVictim, SpellEntry const* spell, SpellEffectIndex effIndex, bool canReflect = false, Spell* spellPtr = nullptr); + void ProcDamageAndSpell(Unit* pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellEntry const* procSpell = nullptr, Spell* spell = nullptr); + void CalculateSpellDamage(SpellNonMeleeDamage* damageInfo, int32 damage, SpellEntry const* spellInfo, WeaponAttackType attackType = BASE_ATTACK, Spell* spell = nullptr); int32 CalculateSpellDamage(Unit const* target, SpellEntry const* spellProto, SpellEffectIndex effect_index, int32 const* basePoints = nullptr, Spell* spell = nullptr); - int32 SpellBonusWithCoeffs(SpellEntry const *spellProto, int32 total, int32 benefit, int32 ap_benefit, DamageEffectType damagetype, bool donePart, WorldObject *pCaster, Spell* spell = nullptr) const; + int32 SpellBonusWithCoeffs(SpellEntry const* spellProto, int32 total, int32 benefit, int32 ap_benefit, DamageEffectType damagetype, bool donePart, WorldObject* pCaster, Spell* spell = nullptr) const; static float CalculateLevelPenalty(SpellEntry const* spellProto); - uint32 SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1, Spell* spell = nullptr); + uint32 SpellDamageBonusDone(Unit* pVictim, SpellEntry const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1, Spell* spell = nullptr); int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask); - uint32 SpellHealingBonusDone(Unit *pVictim, SpellEntry const *spellProto, int32 healamount, DamageEffectType damagetype, uint32 stack = 1, Spell* spell = nullptr); + uint32 SpellHealingBonusDone(Unit* pVictim, SpellEntry const* spellProto, int32 healamount, DamageEffectType damagetype, uint32 stack = 1, Spell* spell = nullptr); int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask); uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage) const; - uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellEntry const *spellProto = nullptr, DamageEffectType damagetype = DIRECT_DAMAGE, uint32 stack = 1, Spell* spell = nullptr, bool flat = true); + uint32 MeleeDamageBonusDone(Unit* pVictim, uint32 damage, WeaponAttackType attType, SpellEntry const* spellProto = nullptr, DamageEffectType damagetype = DIRECT_DAMAGE, uint32 stack = 1, Spell* spell = nullptr, bool flat = true); virtual SpellSchoolMask GetMeleeDamageSchoolMask() const; float GetAPMultiplier(WeaponAttackType attType, bool normalized) const; - virtual uint32 DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const *spellProto, bool durabilityLoss, Spell* spell = nullptr); - void DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb); - void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss); - void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log); - void SendSpellNonMeleeDamageLog(Unit *target, uint32 spellID, uint32 damage, SpellSchoolMask damageSchoolMask, uint32 absorbedDamage, int32 resist, bool isPeriodic, uint32 blocked, bool criticalHit = false, bool split = false); - void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo); - int32 DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellProto, bool critical = false); + virtual uint32 DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const* spellProto, bool durabilityLoss, Spell* spell = nullptr); + void DealDamageMods(Unit* pVictim, uint32 &damage, uint32* absorb); + void DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss); + void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage* log); + void SendSpellNonMeleeDamageLog(Unit* target, uint32 spellID, uint32 damage, SpellSchoolMask damageSchoolMask, uint32 absorbedDamage, int32 resist, bool isPeriodic, uint32 blocked, bool criticalHit = false, bool split = false); + void SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo); + int32 DealHeal(Unit* pVictim, uint32 addhealth, SpellEntry const* spellProto, bool critical = false); void SendHealSpellLog(Unit const* pVictim, uint32 SpellID, uint32 Damage, bool critical = false) const; - void EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype); + void EnergizeBySpell(Unit* pVictim, uint32 SpellID, uint32 Damage, Powers powertype); void SendEnergizeSpellLog(Unit const* pVictim, uint32 SpellID, uint32 Damage, Powers powertype) const; void GetDynObjects(uint32 spellId, SpellEffectIndex effectIndex, std::vector& dynObjsOut); @@ -1104,7 +1104,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object // draw distance can be expensive for updates with lots of players float m_visibilityModifier; - Map * m_currMap; //current object's Map location + Map* m_currMap; //current object's Map location uint32 m_mapId; // object at map with map_id uint32 m_InstanceId; // in map copy with instance id diff --git a/src/game/Objects/Pet.cpp b/src/game/Objects/Pet.cpp index 884c109d7..49cd1dffd 100644 --- a/src/game/Objects/Pet.cpp +++ b/src/game/Objects/Pet.cpp @@ -132,7 +132,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c // current pet (slot 0) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 /*result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, loyaltypoints, loyalty, trainpoint, slot, name, renamed, curhealth, curmana, curhappiness, abdata, TeachSpelldata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType " "FROM character_pet WHERE owner = '%u' AND slot = '%u'", - ownerid, PET_SAVE_AS_CURRENT );*/ + ownerid, PET_SAVE_AS_CURRENT);*/ m_pTmpCache = sCharacterDatabaseCache.GetCharacterCurrentPet(ownerid); } else if (petentry) @@ -478,8 +478,8 @@ void Pet::SavePetToDB(PetSaveMode mode) uint32 curmana = GetPower(POWER_MANA); // stable and not in slot saves - if ( (mode != PET_SAVE_AS_CURRENT && getPetType() != HUNTER_PET) || - mode == PET_SAVE_FIRST_STABLE_SLOT || mode == PET_SAVE_LAST_STABLE_SLOT ) + if ((mode != PET_SAVE_AS_CURRENT && getPetType() != HUNTER_PET) || + mode == PET_SAVE_FIRST_STABLE_SLOT || mode == PET_SAVE_LAST_STABLE_SLOT) RemoveAllAuras(); //save pet's data as one single transaction @@ -1628,7 +1628,7 @@ void Pet::_LoadSpellCooldowns() DEBUG_LOG("Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time - curTime)); } - //while( result->NextRow() ); + //while (result->NextRow()); //delete result; @@ -1687,7 +1687,7 @@ void Pet::_LoadSpells() //Field *fields = result->Fetch(); AddSpell(it->spell, ActiveStates(it->active), PETSPELL_UNCHANGED); } - //while( result->NextRow() ); + //while (result->NextRow()); //delete result; } } @@ -1832,7 +1832,7 @@ void Pet::_LoadAuras(uint32 timediff) else delete holder; } - //while( result->NextRow() ); + //while (result->NextRow()); //delete result; } diff --git a/src/game/Objects/Pet.h b/src/game/Objects/Pet.h index 9fc5d85fe..5beba1fe9 100644 --- a/src/game/Objects/Pet.h +++ b/src/game/Objects/Pet.h @@ -158,7 +158,7 @@ class MANGOS_DLL_SPEC Pet : public Creature bool Create (uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const* cinfo, uint32 pet_number); bool CreateBaseAtCreature(Creature* creature); - bool LoadPetFromDB( Player* owner,uint32 petentry = 0,uint32 petnumber = 0, bool current = false ); + bool LoadPetFromDB(Player* owner,uint32 petentry = 0,uint32 petnumber = 0, bool current = false); void SavePetToDB(PetSaveMode mode); void Unsummon(PetSaveMode mode, Unit* owner = nullptr); void DelayedUnsummon(uint32 timeMSToDespawn, PetSaveMode mode); diff --git a/src/game/Objects/Player.cpp b/src/game/Objects/Player.cpp index 9b965c1a3..db7325762 100644 --- a/src/game/Objects/Player.cpp +++ b/src/game/Objects/Player.cpp @@ -282,9 +282,9 @@ SpellModifier::SpellModifier(SpellModOp _op, SpellModType _type, int32 _value, A mask = sSpellMgr.GetSpellAffectMask(aura->GetId(), aura->GetEffIndex()); } -bool SpellModifier::isAffectedOnSpell(SpellEntry const *spell) const +bool SpellModifier::isAffectedOnSpell(SpellEntry const* spell) const { - SpellEntry const *affect_spell = sSpellMgr.GetSpellEntry(spellId); + SpellEntry const* affect_spell = sSpellMgr.GetSpellEntry(spellId); // False if affect_spell == nullptr or spellFamily not equal if (!affect_spell || affect_spell->SpellFamilyName != spell->SpellFamilyName) return false; @@ -418,7 +418,7 @@ void TradeData::SetAccepted(bool state, bool crosssend /*= false*/) UpdateMask Player::updateVisualBits; -Player::Player(WorldSession *session) : Unit(), +Player::Player(WorldSession* session) : Unit(), m_mover(this), m_camera(this), m_reputationMgr(this), m_enableInstanceSwitch(true), m_currentTicketCounter(0), m_castingSpell(0), m_honorMgr(this), m_bNextRelocationsIgnored(0), m_personalXpRate(-1.0f), m_standStateTimer(0), m_newStandState(MAX_UNIT_STAND_STATE), m_foodEmoteTimer(0) @@ -593,7 +593,7 @@ Player::Player(WorldSession *session) : Unit(), // GM variables m_gmInvisibilityLevel = session->GetSecurity(); - if(session->GetSecurity() > SEC_MODERATOR) + if (session->GetSecurity() > SEC_MODERATOR) m_smartInstanceRebind = true; // TODO: remove it @@ -1596,7 +1596,7 @@ void Player::AutoReSummonPet() } -bool Player::BuildEnumData(QueryResult * result, WorldPacket * p_data) +bool Player::BuildEnumData(QueryResult* result, WorldPacket* p_data) { // 0 1 2 3 4 5 6 7 // "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, " @@ -1605,13 +1605,13 @@ bool Player::BuildEnumData(QueryResult * result, WorldPacket * p_data) // 15 16 17 18 19 // "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache " - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); uint8 pRace = fields[2].GetUInt8(); uint8 pClass = fields[3].GetUInt8(); - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(pRace, pClass); + PlayerInfo const* info = sObjectMgr.GetPlayerInfo(pRace, pClass); if (!info) { sLog.outError("Player %u has incorrect race/class pair. Don't build enum.", guid); @@ -1690,7 +1690,7 @@ bool Player::BuildEnumData(QueryResult * result, WorldPacket * p_data) { uint32 visualbase = slot * 2; // entry, perm ench., temp ench. uint32 item_id = GetUInt32ValueFromArray(data, visualbase); - const ItemPrototype * proto = ObjectMgr::GetItemPrototype(item_id); + const ItemPrototype* proto = ObjectMgr::GetItemPrototype(item_id); if (!proto) { *p_data << uint32(0); @@ -1939,21 +1939,21 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati instanceId = state->GetInstanceId(); if (mapid <= 1) instanceId = sMapMgr.GetContinentInstanceId(mapid, x, y); - Map *map = sMapMgr.FindMap(mapid, instanceId); + Map* map = sMapMgr.FindMap(mapid, instanceId); if (map && !map->CanEnter(this)) return false; // Far teleport to another map. We can't do this right now since it means // we need to remove from this map mid-update. Instead, schedule it for // after updates are complete - ScheduledTeleportData *data = new ScheduledTeleportData(mapid, x, y, z, orientation, options, recover); + ScheduledTeleportData* data = new ScheduledTeleportData(mapid, x, y, z, orientation, options, recover); sMapMgr.ScheduleFarTeleport(this, data); } return true; } -bool Player::ExecuteTeleportFar(ScheduledTeleportData *data) +bool Player::ExecuteTeleportFar(ScheduledTeleportData* data) { Map* oldmap = IsInWorld() ? GetMap() : nullptr; // check if we can enter before stopping combat / removing pet / totems / interrupting spells @@ -1972,7 +1972,7 @@ bool Player::ExecuteTeleportFar(ScheduledTeleportData *data) instanceId = state->GetInstanceId(); if (mapid <= 1) instanceId = sMapMgr.GetContinentInstanceId(mapid, data->x, data->y); - Map *map = sMapMgr.FindMap(mapid, instanceId); + Map* map = sMapMgr.FindMap(mapid, instanceId); if (!map || map->CanEnter(this)) { //lets reset near teleport flag if it wasn't reset during chained teleports @@ -2292,7 +2292,7 @@ void Player::Regenerate(Powers power) if (recentCast) { // Mangos Updates Mana in intervals of 2s, which is correct - addvalue = m_modManaRegenInterrupt * ManaIncreaseRate * 2.00f; + addvalue = m_modManaRegenInterrupt * ManaIncreaseRate * 2.00f; } else addvalue = m_modManaRegen * ManaIncreaseRate * 2.00f; @@ -2412,7 +2412,7 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask) c return nullptr; // exist (we need look pets also for some interaction (quest/etc) - Creature *pCreature = GetMap()->GetAnyTypeCreature(guid); + Creature* pCreature = GetMap()->GetAnyTypeCreature(guid); return CanInteractWithNPC(pCreature, npcflagmask) ? pCreature : nullptr; } @@ -2481,7 +2481,7 @@ GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, uint32 gameo if (!guid || !IsInWorld() || IsTaxiFlying()) return nullptr; - GameObject *pGo = GetMap()->GetGameObject(guid); + GameObject* pGo = GetMap()->GetGameObject(guid); return CanInteractWithGameObject(pGo, gameobject_type) ? pGo : nullptr; } @@ -2943,7 +2943,7 @@ void Player::GiveLevel(uint32 level) numGroupMembers = group->GetMembersCount(); for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next()) { - if (Player *player = itr->getSource()) + if (Player* player = itr->getSource()) { if (!first) groupInfo << ", "; @@ -3068,7 +3068,7 @@ void Player::GiveLevel(uint32 level) void Player::UpdateFreeTalentPoints(bool resetIfNeed) { uint32 level = GetLevel(); - // talents base at level diff ( talents = level - 9 but some can be used already) + // talents base at level diff (talents = level - 9 but some can be used already) if (level < 10) { // Remove all talent points @@ -3288,7 +3288,7 @@ void Player::SendInitialSpells() const data << uint16(spellCooldowns); for (SpellCooldowns::const_iterator itr = m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr) { - SpellEntry const *sEntry = sSpellMgr.GetSpellEntry(itr->first); + SpellEntry const* sEntry = sSpellMgr.GetSpellEntry(itr->first); if (!sEntry) continue; @@ -3335,7 +3335,7 @@ void Player::SendInitialSpells() const bool Player::AddSpell(uint32 spell_id, bool active, bool learning, bool dependent, bool disabled) { - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spell_id); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(spell_id); if (!spellInfo) { // do character spell book cleanup (all characters) @@ -3476,7 +3476,7 @@ bool Player::AddSpell(uint32 spell_id, bool active, bool learning, bool dependen // talent: unlearn all other talent ranks (high and low) if (talentPos) { - if (TalentEntry const *talentInfo = sTalentStore.LookupEntry(talentPos->talent_id)) + if (TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentPos->talent_id)) { for (int i = 0; i < MAX_TALENT_RANK; ++i) { @@ -3805,7 +3805,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs) if (itr->second.state == PLAYERSPELL_REMOVED) continue; uint32 unSpellId = itr->first; - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(unSpellId); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(unSpellId); MANGOS_ASSERT(spellInfo); // Not send cooldown for this spells @@ -3823,11 +3823,11 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs) Unit::ProhibitSpellSchool(idSchoolMask, unTimeMs); } -void Player::_LoadSpellCooldowns(QueryResult *result) +void Player::_LoadSpellCooldowns(QueryResult* result) { // some cooldowns can be already set at aura loading... - //QueryResult *result = CharacterDatabase.PQuery("SELECT spell,item,time,cattime FROM character_spell_cooldown WHERE guid = '%u'",GetGUIDLow()); + //QueryResult* result = CharacterDatabase.PQuery("SELECT spell,item,time,cattime FROM character_spell_cooldown WHERE guid = '%u'",GetGUIDLow()); if (result) { @@ -3835,7 +3835,7 @@ void Player::_LoadSpellCooldowns(QueryResult *result) do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 spell_id = fields[0].GetUInt32(); uint32 item_id = fields[1].GetUInt32(); @@ -3979,7 +3979,7 @@ bool Player::ResetTalents(bool no_cost) for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i) { - TalentEntry const *talentInfo = sTalentStore.LookupEntry(i); + TalentEntry const* talentInfo = sTalentStore.LookupEntry(i); if (!talentInfo) continue; @@ -4028,7 +4028,7 @@ bool Player::ResetTalents(bool no_cost) return true; } -void Player::_SetCreateBits(UpdateMask *updateMask, Player *target) const +void Player::_SetCreateBits(UpdateMask* updateMask, Player* target) const { if (target == this) Object::_SetCreateBits(updateMask, target); @@ -4042,7 +4042,7 @@ void Player::_SetCreateBits(UpdateMask *updateMask, Player *target) const } } -void Player::_SetUpdateBits(UpdateMask *updateMask, Player *target) const +void Player::_SetUpdateBits(UpdateMask* updateMask, Player* target) const { if (target == this) Object::_SetUpdateBits(updateMask, target); @@ -4153,7 +4153,7 @@ void Player::InitVisibleBits() } } -void Player::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const +void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const { if (target == this) { @@ -4183,7 +4183,7 @@ void Player::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) c Unit::BuildCreateUpdateBlockForPlayer(data, target); } -void Player::DestroyForPlayer(Player *target) const +void Player::DestroyForPlayer(Player* target) const { Unit::DestroyForPlayer(target); @@ -4360,12 +4360,12 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe case 0: { // return back all mails with COD and Item 0 1 2 3 4 5 6 7 - QueryResult *resultMail = CharacterDatabase.PQuery("SELECT id,messageType,mailTemplateId,sender,subject,itemTextId,money,has_items FROM mail WHERE receiver='%u' AND has_items<>0 AND cod<>0", lowguid); + QueryResult* resultMail = CharacterDatabase.PQuery("SELECT id,messageType,mailTemplateId,sender,subject,itemTextId,money,has_items FROM mail WHERE receiver='%u' AND has_items<>0 AND cod<>0", lowguid); if (resultMail) { do { - Field *fields = resultMail->Fetch(); + Field* fields = resultMail->Fetch(); uint32 mail_id = fields[0].GetUInt32(); uint16 mailType = fields[1].GetUInt16(); @@ -4397,12 +4397,12 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe if (has_items) { // data needs to be at first place for Item::LoadFromDB - QueryResult *resultItems = CharacterDatabase.PQuery("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, text, item_guid, itemEntry, generated_loot FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail_id); + QueryResult* resultItems = CharacterDatabase.PQuery("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, text, item_guid, itemEntry, generated_loot FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail_id); if (resultItems) { do { - Field *fields2 = resultItems->Fetch(); + Field* fields2 = resultItems->Fetch(); uint32 item_guidlow = fields2[10].GetUInt32(); uint32 item_template = fields2[11].GetUInt32(); @@ -4414,7 +4414,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe continue; } - Item *pItem = NewItemOrBag(itemProto); + Item* pItem = NewItemOrBag(itemProto); if (!pItem->LoadFromDB(item_guidlow, playerguid, fields2, item_template)) { pItem->FSetState(ITEM_REMOVED); @@ -4443,7 +4443,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe // unsummon and delete for pets in world is not required: player deleted from CLI or character list with not loaded pet. // Get guids of character's pets, will deleted in transaction - QueryResult *resultPets = CharacterDatabase.PQuery("SELECT id FROM character_pet WHERE owner = '%u'", lowguid); + QueryResult* resultPets = CharacterDatabase.PQuery("SELECT id FROM character_pet WHERE owner = '%u'", lowguid); // NOW we can finally clear other DB data related to character CharacterDatabase.BeginTransaction(); @@ -4451,7 +4451,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe { do { - Field *fields3 = resultPets->Fetch(); + Field* fields3 = resultPets->Fetch(); uint32 petguidlow = fields3[0].GetUInt32(); //do not create separate transaction for pet delete otherwise we will get fatal error! Pet::DeleteFromDB(petguidlow, false); @@ -4521,12 +4521,12 @@ void Player::DeleteOldCharacters() */ void Player::DeleteOldCharacters(uint32 keepDays) { - QueryResult *resultChars = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < '" UI64FMTD "' LIMIT 0,2", uint64(time(nullptr) - time_t(keepDays * DAY))); + QueryResult* resultChars = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < '" UI64FMTD "' LIMIT 0,2", uint64(time(nullptr) - time_t(keepDays * DAY))); if (resultChars) { do { - Field *charFields = resultChars->Fetch(); + Field* charFields = resultChars->Fetch(); ObjectGuid guid = ObjectGuid(HIGHGUID_PLAYER, charFields[0].GetUInt32()); Player::DeleteFromDB(guid, charFields[1].GetUInt32(), true, true); } @@ -4680,7 +4680,7 @@ void Player::KillPlayer() StopMirrorTimers(); //disable timers(bars) SetDeathState(CORPSE); - //SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_IN_PVP ); + //SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_IN_PVP); SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); ApplyModByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStorage.LookupEntry(GetMapId())->Instanceable()); @@ -4701,7 +4701,7 @@ Corpse* Player::CreateCorpse() // prevent existence 2 corpse for player SpawnCorpseBones(); - Corpse *corpse = new Corpse((m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH) ? CORPSE_RESURRECTABLE_PVP : CORPSE_RESURRECTABLE_PVE); + Corpse* corpse = new Corpse((m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH) ? CORPSE_RESURRECTABLE_PVP : CORPSE_RESURRECTABLE_PVE); SetPvPDeath(false); if (!corpse->Create(sObjectMgr.GenerateCorpseLowGuid(), this)) @@ -4775,7 +4775,7 @@ Corpse* Player::GetCorpse() const void Player::DurabilityLossAll(double percent, bool inventory) { for (int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) - if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) DurabilityLoss(pItem, percent); if (inventory) @@ -4784,7 +4784,7 @@ void Player::DurabilityLossAll(double percent, bool inventory) // for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) for (int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) DurabilityLoss(pItem, percent); // keys not have durability @@ -4819,7 +4819,7 @@ void Player::DurabilityLoss(Item* item, double percent) void Player::DurabilityPointsLossAll(int32 points, bool inventory) { for (int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) - if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) DurabilityPointsLoss(pItem, points); if (inventory) @@ -4828,7 +4828,7 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) // for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) for (int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) DurabilityPointsLoss(pItem, points); // keys not have durability @@ -4871,7 +4871,7 @@ void Player::DurabilityPointsLoss(Item* item, int32 points) void Player::DurabilityPointLossForEquipSlot(EquipmentSlots slot) { - if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) DurabilityPointsLoss(pItem, 1); } @@ -4910,9 +4910,9 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod) uint32 LostDurability = maxDurability - curDurability; if (LostDurability > 0) { - ItemPrototype const *ditemProto = item->GetProto(); + ItemPrototype const* ditemProto = item->GetProto(); - DurabilityCostsEntry const *dcost = sDurabilityCostsStore.LookupEntry(ditemProto->ItemLevel); + DurabilityCostsEntry const* dcost = sDurabilityCostsStore.LookupEntry(ditemProto->ItemLevel); if (!dcost) { sLog.outError("RepairDurability: Wrong item lvl %u", ditemProto->ItemLevel); @@ -4920,7 +4920,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod) } uint32 dQualitymodEntryId = (ditemProto->Quality + 1) * 2; - DurabilityQualityEntry const *dQualitymodEntry = sDurabilityQualityStore.LookupEntry(dQualitymodEntryId); + DurabilityQualityEntry const* dQualitymodEntry = sDurabilityQualityStore.LookupEntry(dQualitymodEntryId); if (!dQualitymodEntry) { sLog.outError("RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntryId); @@ -4959,11 +4959,11 @@ void Player::RepopAtGraveyard() // note: this can be called also when the player is alive // for example from WorldSession::HandleMovementOpcodes - WorldSafeLocsEntry const *ClosestGrave = nullptr; + WorldSafeLocsEntry const* ClosestGrave = nullptr; // Special handle for battleground maps std::function recover; - if (BattleGround *bg = GetBattleGround()) + if (BattleGround* bg = GetBattleGround()) { ClosestGrave = bg->GetClosestGraveYard(this); recover = [this](){ @@ -5016,12 +5016,12 @@ void Player::RepopAtGraveyard() UpdateVisibilityAndView(); } -void Player::JoinedChannel(Channel *c) +void Player::JoinedChannel(Channel* c) { m_channels.push_back(c); } -void Player::LeftChannel(Channel *c) +void Player::LeftChannel(Channel* c) { m_channels.remove(c); } @@ -5283,10 +5283,10 @@ void Player::SetRegularAttackTime(bool resetTimer) { for (int i = 0; i < MAX_ATTACK; ++i) { - Item *tmpitem = GetWeaponForAttack(WeaponAttackType(i), true, false); + Item* tmpitem = GetWeaponForAttack(WeaponAttackType(i), true, false); if (tmpitem) { - ItemPrototype const *proto = tmpitem->GetProto(); + ItemPrototype const* proto = tmpitem->GetProto(); if (proto->Delay) SetAttackTime(WeaponAttackType(i), proto->Delay, resetTimer); else @@ -5449,7 +5449,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) void Player::UpdateWeaponSkill(WeaponAttackType attType) { // no skill gain in pvp - Unit *pVictim = GetVictim(); + Unit* pVictim = GetVictim(); if (pVictim && pVictim->IsCharmerOrOwnerPlayerOrPlayerItself()) return; @@ -5465,7 +5465,7 @@ void Player::UpdateWeaponSkill(WeaponAttackType attType) { case BASE_ATTACK: { - Item *tmpitem = GetWeaponForAttack(attType, true, true); + Item* tmpitem = GetWeaponForAttack(attType, true, true); if (!tmpitem) UpdateSkill(SKILL_UNARMED, weapon_skill_gain); @@ -5476,7 +5476,7 @@ void Player::UpdateWeaponSkill(WeaponAttackType attType) case OFF_ATTACK: case RANGED_ATTACK: { - Item *tmpitem = GetWeaponForAttack(attType, true, true); + Item* tmpitem = GetWeaponForAttack(attType, true, true); if (tmpitem) UpdateSkill(tmpitem->GetSkill(), weapon_skill_gain); break; @@ -5485,7 +5485,7 @@ void Player::UpdateWeaponSkill(WeaponAttackType attType) UpdateAllCritPercentages(); } -void Player::UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool defence) +void Player::UpdateCombatSkills(Unit* pVictim, WeaponAttackType attType, bool defence) { uint32 plevel = GetLevel(); // if defense than pVictim == attacker uint32 greylevel = MaNGOS::XP::GetGrayLevel(plevel); @@ -5545,7 +5545,7 @@ void Player::UpdateSkillsForLevel() uint32 pskill = itr->first; - SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(pskill); + SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(pskill); if (!pSkill) continue; @@ -5685,7 +5685,7 @@ void Player::SetSkill(uint16 id, uint16 currVal, uint16 maxVal, uint16 step /*=0 { if (!GetUInt32Value(PLAYER_SKILL_INDEX(i))) { - SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(id); + SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(id); if (!pSkill) { sLog.outError("Skill not found in SkillLineStore: skill #%u", id); @@ -6017,7 +6017,7 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele return false; } - Map *m = GetMap(); + Map* m = GetMap(); const float old_x = GetPositionX(); const float old_y = GetPositionY(); @@ -6071,7 +6071,7 @@ void Player::SaveRecallPosition() m_recallO = GetOrientation(); } -void Player::SendMessageToSet(WorldPacket *data, bool self) const +void Player::SendMessageToSet(WorldPacket* data, bool self) const { if (IsInWorld()) GetMap()->MessageBroadcast(this, data, false); @@ -6082,7 +6082,7 @@ void Player::SendMessageToSet(WorldPacket *data, bool self) const GetSession()->SendPacket(data); } -void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self) const +void Player::SendMessageToSetInRange(WorldPacket* data, float dist, bool self) const { if (IsInWorld()) GetMap()->MessageDistBroadcast(this, data, dist, false); @@ -6091,7 +6091,7 @@ void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self) c GetSession()->SendPacket(data); } -void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool own_team_only) const +void Player::SendMessageToSetInRange(WorldPacket* data, float dist, bool self, bool own_team_only) const { if (IsInWorld()) GetMap()->MessageDistBroadcast(this, data, dist, false, own_team_only); @@ -6100,7 +6100,7 @@ void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self, b GetSession()->SendPacket(data); } -void Player::SendDirectMessage(WorldPacket *data) const +void Player::SendDirectMessage(WorldPacket* data) const { GetSession()->SendPacket(data); } @@ -6151,7 +6151,7 @@ void Player::CheckAreaExploreAndOutdoor() { if (itr->second.state == PLAYERSPELL_REMOVED) continue; - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(itr->first); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(itr->first); if (!spellInfo || !spellInfo->IsNeedCastSpellAtFormApply(GetShapeshiftForm()) || !(spellInfo->Attributes & SPELL_ATTR_OUTDOORS_ONLY) || HasAura(spellInfo->Id)) @@ -6185,7 +6185,7 @@ void Player::CheckAreaExploreAndOutdoor() { SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, (uint32)(currFields | val)); - const auto *p = AreaEntry::GetByAreaFlagAndMap(areaFlag, GetMapId()); + const auto* p = AreaEntry::GetByAreaFlagAndMap(areaFlag, GetMapId()); if (!p) sLog.outError("PLAYER: Player %u discovered unknown area (x: %f y: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetMapId()); else if (p->AreaLevel > 0) @@ -6349,7 +6349,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, int32 rep, int32 return 0; // Multiply result with the faction specific rate - if (const RepRewardRate *repData = sObjectMgr.GetRepRewardRate(faction)) + if (RepRewardRate const* repData = sObjectMgr.GetRepRewardRate(faction)) { float repRate = 0.0f; switch (source) @@ -6376,7 +6376,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, int32 rep, int32 } //Calculates how many reputation points player gains in victim's enemy factions -void Player::RewardReputation(Unit *pVictim, float rate) +void Player::RewardReputation(Unit* pVictim, float rate) { if (!pVictim || pVictim->IsPlayer()) return; @@ -6395,7 +6395,7 @@ void Player::RewardReputation(Unit *pVictim, float rate) { int32 donerep1 = CalculateReputationGain(REPUTATION_SOURCE_KILL, Rep->repvalue1, Rep->repfaction1, pVictim->GetLevel()); donerep1 = int32(donerep1 * rate); - FactionEntry const *factionEntry1 = sObjectMgr.GetFactionEntry(Rep->repfaction1); + FactionEntry const* factionEntry1 = sObjectMgr.GetFactionEntry(Rep->repfaction1); uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1); // World of Warcraft Client Patch 1.9.0 (2006-01-03) @@ -6414,7 +6414,7 @@ void Player::RewardReputation(Unit *pVictim, float rate) // Wiki: Team factions value divided by 2 if (factionEntry1 && Rep->is_teamaward1) { - FactionEntry const *team1_factionEntry = sObjectMgr.GetFactionEntry(factionEntry1->team); + FactionEntry const* team1_factionEntry = sObjectMgr.GetFactionEntry(factionEntry1->team); if (team1_factionEntry) GetReputationMgr().ModifyReputation(team1_factionEntry, donerep1 / 2, true); } @@ -6424,7 +6424,7 @@ void Player::RewardReputation(Unit *pVictim, float rate) { int32 donerep2 = CalculateReputationGain(REPUTATION_SOURCE_KILL, Rep->repvalue2, Rep->repfaction2, pVictim->GetLevel()); donerep2 = int32(donerep2 * rate); - FactionEntry const *factionEntry2 = sObjectMgr.GetFactionEntry(Rep->repfaction2); + FactionEntry const* factionEntry2 = sObjectMgr.GetFactionEntry(Rep->repfaction2); uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2); #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4 @@ -6437,7 +6437,7 @@ void Player::RewardReputation(Unit *pVictim, float rate) // Wiki: Team factions value divided by 2 if (factionEntry2 && Rep->is_teamaward2) { - FactionEntry const *team2_factionEntry = sObjectMgr.GetFactionEntry(factionEntry2->team); + FactionEntry const* team2_factionEntry = sObjectMgr.GetFactionEntry(factionEntry2->team); if (team2_factionEntry) GetReputationMgr().ModifyReputation(team2_factionEntry, donerep2 / 2, true); } @@ -6445,7 +6445,7 @@ void Player::RewardReputation(Unit *pVictim, float rate) } //Calculate how many reputation points player gain with the quest -void Player::RewardReputation(Quest const *pQuest) +void Player::RewardReputation(Quest const* pQuest) { // quest reputation reward/loss for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) @@ -6480,7 +6480,7 @@ uint32 Player::GetGuildIdFromDB(ObjectGuid guid) uint32 Player::GetRankFromDB(ObjectGuid guid) { - QueryResult *result = CharacterDatabase.PQuery("SELECT rank FROM guild_member WHERE guid='%u'", guid.GetCounter()); + QueryResult* result = CharacterDatabase.PQuery("SELECT rank FROM guild_member WHERE guid='%u'", guid.GetCounter()); if (result) { uint32 v = result->Fetch()[0].GetUInt32(); @@ -6504,7 +6504,7 @@ uint32 Player::GetZoneIdFromDB(ObjectGuid guid) } else { - QueryResult *result = CharacterDatabase.PQuery("SELECT zone FROM characters WHERE guid='%u'", lowguid); + QueryResult* result = CharacterDatabase.PQuery("SELECT zone FROM characters WHERE guid='%u'", lowguid); if (!result) return 0; Field* fields = result->Fetch(); @@ -6543,7 +6543,7 @@ uint32 Player::GetLevelFromDB(ObjectGuid guid) } else { - QueryResult *result = CharacterDatabase.PQuery("SELECT level FROM characters WHERE guid='%u'", lowguid); + QueryResult* result = CharacterDatabase.PQuery("SELECT level FROM characters WHERE guid='%u'", lowguid); if (!result) return 0; @@ -6591,7 +6591,7 @@ void Player::UpdateArea(uint32 newArea) DismountCheck(); - const auto *areaEntry = AreaEntry::GetById(newArea); + const auto* areaEntry = AreaEntry::GetById(newArea); // FFA_PVP flags are area and not zone id dependent // so apply them accordingly @@ -6615,7 +6615,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) { uint32 oldZoneId = m_zoneUpdateId; - const auto *zoneEntry = AreaEntry::GetById(newZone); + const auto* zoneEntry = AreaEntry::GetById(newZone); if (!zoneEntry) return; @@ -6819,7 +6819,7 @@ void Player::DuelComplete(DuelCompleteType type) //---------------------------------------------------------// -void Player::_ApplyItemMods(Item *item, uint8 slot, bool apply) +void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply) { if (slot >= INVENTORY_SLOT_BAG_END || !item) return; @@ -6828,7 +6828,7 @@ void Player::_ApplyItemMods(Item *item, uint8 slot, bool apply) if (item->IsBroken()) return; - ItemPrototype const *proto = item->GetProto(); + ItemPrototype const* proto = item->GetProto(); if (!proto) return; @@ -6867,7 +6867,7 @@ void Player::_ApplyItemMods(Item *item, uint8 slot, bool apply) DEBUG_LOG("_ApplyItemMods complete."); } -void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool apply) +void Player::_ApplyItemBonuses(ItemPrototype const* proto, uint8 slot, bool apply) { if (slot >= INVENTORY_SLOT_BAG_END || !proto) return; @@ -6992,7 +6992,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl } } -void Player::_ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply) +void Player::_ApplyWeaponDependentAuraMods(Item* item, WeaponAttackType attackType, bool apply) { if (apply && !CanUseEquippedWeapon(attackType)) return; @@ -7010,7 +7010,7 @@ void Player::_ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackTy _ApplyWeaponDependentAuraDamageMod(item, attackType, *itr, apply); } -void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply) +void Player::_ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attackType, Aura* aura, bool apply) { // don't apply mod if item is broken or cannot be used if (item->IsBroken() || !CanUseEquippedWeapon(attackType)) @@ -7048,7 +7048,7 @@ void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attac HandleBaseModValue(mod, FLAT_MOD, float(aura->GetModifier()->m_amount), apply); } -void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply) +void Player::_ApplyWeaponDependentAuraDamageMod(Item* item, WeaponAttackType attackType, Aura* aura, bool apply) { // ignore spell mods for not wands Modifier const* modifier = aura->GetModifier(); @@ -7092,12 +7092,12 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att HandleStatModifier(unitMod, unitModType, float(modifier->m_amount), apply); } -void Player::ApplyItemEquipSpell(Item *item, bool apply, bool form_change) +void Player::ApplyItemEquipSpell(Item* item, bool apply, bool form_change) { if (!item) return; - ItemPrototype const *proto = item->GetProto(); + ItemPrototype const* proto = item->GetProto(); if (!proto) return; @@ -7219,11 +7219,11 @@ void Player::UpdateEquipSpellsAtFormChange() void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType) { - Item *item = GetWeaponForAttack(attType, true, true); + Item* item = GetWeaponForAttack(attType, true, true); if (!item) return; - ItemPrototype const *proto = item->GetProto(); + ItemPrototype const* proto = item->GetProto(); if (!proto) return; @@ -7244,7 +7244,7 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType) if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_CHANCE_ON_HIT) continue; - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spellData.SpellId); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(spellData.SpellId); if (!spellInfo) { sLog.outError("WORLD: unknown Item spellid %i", spellData.SpellId); @@ -7252,7 +7252,7 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType) } // not allow proc extra attack spell at extra attack - if (GetExtraAttacks() && spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS) ) + if (GetExtraAttacks() && spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) return; float chance = (float)spellInfo->procChance; @@ -7272,7 +7272,7 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType) for (int e_slot = 0; e_slot < MAX_ENCHANTMENT_SLOT; ++e_slot) { uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot)); - SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); + SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); if (!pEnchant) continue; for (int s = 0; s < 3; ++s) { @@ -7281,7 +7281,7 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType) if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(proc_spell_id); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(proc_spell_id); if (!spellInfo) { sLog.outError("Player::CastItemCombatSpell Enchant %i, cast unknown spell %i", pEnchant->ID, proc_spell_id); @@ -7321,7 +7321,7 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType) } } -void Player::CastItemUseSpell(Item *item, SpellCastTargets const& targets) +void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets) { ItemPrototype const* proto = item->GetProto(); @@ -7341,14 +7341,14 @@ void Player::CastItemUseSpell(Item *item, SpellCastTargets const& targets) if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE && spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_NO_DELAY_USE) continue; - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spellData.SpellId); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(spellData.SpellId); if (!spellInfo) { sLog.outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring", proto->ItemId, spellData.SpellId); continue; } - Spell *spell = new Spell(this, spellInfo, (count > 0)); + Spell* spell = new Spell(this, spellInfo, (count > 0)); spell->SetCastItem(item); spell->prepare(targets); @@ -7364,7 +7364,7 @@ void Player::_RemoveAllItemMods() { if (m_items[i]) { - ItemPrototype const *proto = m_items[i]->GetProto(); + ItemPrototype const* proto = m_items[i]->GetProto(); if (!proto) continue; @@ -7386,7 +7386,7 @@ void Player::_RemoveAllItemMods() { if (m_items[i]->IsBroken()) continue; - ItemPrototype const *proto = m_items[i]->GetProto(); + ItemPrototype const* proto = m_items[i]->GetProto(); if (!proto) continue; @@ -7415,7 +7415,7 @@ void Player::_ApplyAllItemMods() if (m_items[i]->IsBroken()) continue; - ItemPrototype const *proto = m_items[i]->GetProto(); + ItemPrototype const* proto = m_items[i]->GetProto(); if (!proto) continue; @@ -7434,7 +7434,7 @@ void Player::_ApplyAllItemMods() { if (m_items[i]) { - ItemPrototype const *proto = m_items[i]->GetProto(); + ItemPrototype const* proto = m_items[i]->GetProto(); if (!proto) continue; @@ -7462,7 +7462,7 @@ void Player::_ApplyAmmoBonuses() float currentAmmoDPS; - ItemPrototype const *ammo_proto = ObjectMgr::GetItemPrototype(ammo_id); + ItemPrototype const* ammo_proto = ObjectMgr::GetItemPrototype(ammo_id); if (!ammo_proto || ammo_proto->Class != ITEM_CLASS_PROJECTILE || !CheckAmmoCompatibility(ammo_proto)) currentAmmoDPS = 0.0f; else @@ -7477,13 +7477,13 @@ void Player::_ApplyAmmoBonuses() UpdateDamagePhysical(RANGED_ATTACK); } -bool Player::CheckAmmoCompatibility(const ItemPrototype *ammo_proto) const +bool Player::CheckAmmoCompatibility(ItemPrototype const* ammo_proto) const { if (!ammo_proto) return false; // check ranged weapon - Item *weapon = GetWeaponForAttack(RANGED_ATTACK, true, false); + Item* weapon = GetWeaponForAttack(RANGED_ATTACK, true, false); if (!weapon) return false; @@ -7512,7 +7512,7 @@ bool Player::CheckAmmoCompatibility(const ItemPrototype *ammo_proto) const /* If in a battleground a player dies, and an enemy removes the insignia, the player's bones is lootable Called by remove insignia spell effect */ -void Player::RemovedInsignia(Player* looterPlr, Corpse *corpse) +void Player::RemovedInsignia(Player* looterPlr, Corpse* corpse) { if (!GetBattleGroundId()) return; @@ -7560,7 +7560,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, Player* pVictim) if (ObjectGuid lootGuid = GetLootGuid()) m_session->DoLootRelease(lootGuid); - Loot *loot = 0; + Loot* loot = 0; PermissionTypes permission = ALL_PERMISSION; DEBUG_LOG("Player::SendLoot"); @@ -7573,7 +7573,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, Player* pVictim) case HIGHGUID_GAMEOBJECT: { DEBUG_LOG(" IS_GAMEOBJECT_GUID(guid)"); - GameObject *go = GetMap()->GetGameObject(guid); + GameObject* go = GetMap()->GetGameObject(guid); // not check distance for GO in case owned GO (fishing bobber case, for example) // And permit out of range GO with no owner in case fishing hole @@ -7635,7 +7635,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, Player* pVictim) } case HIGHGUID_ITEM: { - Item *item = GetItemByGuid(guid); + Item* item = GetItemByGuid(guid); if (!item) { @@ -7678,7 +7678,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, Player* pVictim) } case HIGHGUID_CORPSE: // remove insignia { - Corpse *bones = GetMap()->GetCorpse(guid); + Corpse* bones = GetMap()->GetCorpse(guid); if (!bones || !((loot_type == LOOT_CORPSE) || (loot_type == LOOT_INSIGNIA))) { @@ -7788,7 +7788,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, Player* pVictim) } case HIGHGUID_UNIT: { - Creature *creature = GetMap()->GetCreature(guid); + Creature* creature = GetMap()->GetCreature(guid); // must be in range and creature must be alive for pickpocket and must be dead for another loot if (!creature || creature->IsAlive() != (loot_type == LOOT_PICKPOCKETING) || !creature->IsWithinDistInMap(this, INTERACTION_DISTANCE)) @@ -7850,7 +7850,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, Player* pVictim) else { // the player whose group may loot the corpse - Player *recipient = creature->GetLootRecipient(); + Player* recipient = creature->GetLootRecipient(); if (!recipient) return; @@ -8449,7 +8449,7 @@ uint8 Player::FindEquipSlot(ItemPrototype const* proto, uint32 slot, bool swap) InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const { - Item *pItem; + Item* pItem; uint32 tempcount = 0; InventoryResult res = EQUIP_ERR_OK; @@ -8517,13 +8517,13 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const uint32 count = 0; for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) { - Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); if (pItem && pItem != skipItem && pItem->GetEntry() == item) count += pItem->GetCount(); } for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; ++i) { - Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); if (pItem && pItem != skipItem && pItem->GetEntry() == item) count += pItem->GetCount(); } @@ -8556,29 +8556,29 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const Item* Player::GetItemByGuid(ObjectGuid guid) const { for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem->GetObjectGuid() == guid) return pItem; for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; ++i) - if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem->GetObjectGuid() == guid) return pItem; for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) if (Item* pItem = pBag->GetItemByPos(j)) if (pItem->GetObjectGuid() == guid) return pItem; for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem->GetObjectGuid() == guid) return pItem; for (int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) if (Item* pItem = pBag->GetItemByPos(j)) if (pItem->GetObjectGuid() == guid) @@ -8601,7 +8601,7 @@ Item* Player::GetItemByPos(uint8 bag, uint8 slot) const else if ((bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END) || (bag >= BANK_SLOT_BAG_START && bag < BANK_SLOT_BAG_END)) { - Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag); + Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag); if (pBag) return pBag->GetItemByPos(slot); } @@ -8762,7 +8762,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const uint32 tempcount = 0; for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) { - Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { tempcount += pItem->GetCount(); @@ -8772,7 +8772,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const } for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; ++i) { - Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { tempcount += pItem->GetCount(); @@ -8801,7 +8801,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_BAG_END; ++i) { - Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { tempcount += pItem->GetCount(); @@ -8838,7 +8838,7 @@ bool Player::HasItemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot) if (i == int(except_slot)) continue; - Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); if (pItem && pItem->GetEntry() == item) { tempcount += pItem->GetCount(); @@ -8852,7 +8852,7 @@ bool Player::HasItemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot) InventoryResult Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count) const { - ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(entry); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(entry); if (!pProto) { if (no_space_count) @@ -8877,7 +8877,7 @@ InventoryResult Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Ite return EQUIP_ERR_OK; } -InventoryResult Player::_CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec &dest, ItemPrototype const *pProto, uint32& count, bool swap, Item* pSrcItem) const +InventoryResult Player::_CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec &dest, ItemPrototype const* pProto, uint32& count, bool swap, Item* pSrcItem) const { Item* pItem2 = GetItemByPos(bag, slot); @@ -8953,7 +8953,7 @@ InventoryResult Player::_CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, Item return EQUIP_ERR_OK; } -InventoryResult Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemPrototype const *pProto, uint32& count, bool merge, bool non_specialized, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const +InventoryResult Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemPrototype const* pProto, uint32& count, bool merge, bool non_specialized, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const { // skip specific bag already processed in first called _CanStoreItem_InBag if (bag == skip_bag) @@ -9027,7 +9027,7 @@ InventoryResult Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, It return EQUIP_ERR_OK; } -InventoryResult Player::_CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec &dest, ItemPrototype const *pProto, uint32& count, bool merge, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const +InventoryResult Player::_CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec &dest, ItemPrototype const* pProto, uint32& count, bool merge, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const { // Fix dupe exploit (move non empty bag) if (pSrcItem && pSrcItem->IsBag() && !((Bag*)pSrcItem)->IsEmpty()) @@ -9086,11 +9086,11 @@ InventoryResult Player::_CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 s #define LAST_ITEM_SLOT_FIELD PLAYER_FIELD_VENDORBUYBACK_SLOT_LAST #endif -InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item *pItem, bool swap, uint32* no_space_count) const +InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* pItem, bool swap, uint32* no_space_count) const { DEBUG_LOG("STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); - ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(entry); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(entry); if (!pProto) { if (no_space_count) @@ -9466,9 +9466,9 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de } ////////////////////////////////////////////////////////////////////////// -InventoryResult Player::CanStoreItems(Item **pItems, int count) const +InventoryResult Player::CanStoreItems(Item** pItems, int count) const { - Item *pItem2; + Item* pItem2; // fill space table int inv_slot_items[INVENTORY_SLOT_ITEM_END - INVENTORY_SLOT_ITEM_START]; @@ -9511,7 +9511,7 @@ InventoryResult Player::CanStoreItems(Item **pItems, int count) const // check free space for all items for (int k = 0; k < count; ++k) { - Item *pItem = pItems[k]; + Item* pItem = pItems[k]; // no item if (!pItem) continue; @@ -9524,7 +9524,7 @@ InventoryResult Player::CanStoreItems(Item **pItems, int count) const } DEBUG_LOG("STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, pItem->GetEntry(), pItem->GetCount()); - ItemPrototype const *pProto = pItem->GetProto(); + ItemPrototype const* pProto = pItem->GetProto(); // strange item if (!pProto) @@ -9538,8 +9538,8 @@ InventoryResult Player::CanStoreItems(Item **pItems, int count) const if (pItem->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; - Bag *pBag; - ItemPrototype const *pBagProto; + Bag* pBag; + ItemPrototype const* pBagProto; // item is 'one item only' InventoryResult res = CanTakeMoreSimilarItems(pItem); @@ -9690,7 +9690,7 @@ InventoryResult Player::CanStoreItems(Item **pItems, int count) const InventoryResult Player::CanEquipNewItem(uint8 slot, uint16 &dest, uint32 item, bool swap) const { dest = 0; - Item *pItem = Item::CreateItem(item, 1, this); + Item* pItem = Item::CreateItem(item, 1, this); if (pItem) { InventoryResult result = CanEquipItem(slot, dest, pItem, swap); @@ -9701,13 +9701,13 @@ InventoryResult Player::CanEquipNewItem(uint8 slot, uint16 &dest, uint32 item, b return EQUIP_ERR_ITEM_NOT_FOUND; } -InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, bool not_loading) const +InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool swap, bool not_loading) const { dest = 0; if (pItem) { DEBUG_LOG("STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); - ItemPrototype const *pProto = pItem->GetProto(); + ItemPrototype const* pProto = pItem->GetProto(); if (pProto) { // item used @@ -9808,7 +9808,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; // offhand item must can be stored in inventory for offhand item and it also must be unequipped - Item *offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); + Item* offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); ItemPosCountVec off_dest; if (offItem && (!not_loading || CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND, false) != EQUIP_ERR_OK || @@ -9837,7 +9837,7 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const DEBUG_LOG("STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); - ItemPrototype const *pProto = pItem->GetProto(); + ItemPrototype const* pProto = pItem->GetProto(); if (!pProto) return EQUIP_ERR_ITEM_NOT_FOUND; @@ -9867,7 +9867,7 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const return EQUIP_ERR_OK; } -InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pItem, bool swap, bool not_loading) const +InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* pItem, bool swap, bool not_loading) const { if (!pItem) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; @@ -9875,7 +9875,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest uint32 count = pItem->GetCount(); DEBUG_LOG("STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); - ItemPrototype const *pProto = pItem->GetProto(); + ItemPrototype const* pProto = pItem->GetProto(); if (!pProto) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; @@ -9922,7 +9922,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { if (pProto->InventoryType == INVTYPE_BAG) { - Bag *pBag = (Bag*)pItem; + Bag* pBag = (Bag*)pItem; if (pBag && !pBag->IsEmpty()) return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; } @@ -10049,7 +10049,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest return EQUIP_ERR_BANK_FULL; } -InventoryResult Player::CanUseItem(Item *pItem, bool not_loading) const +InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const { if (pItem) { @@ -10061,7 +10061,7 @@ InventoryResult Player::CanUseItem(Item *pItem, bool not_loading) const //if (isStunned()) // return EQUIP_ERR_YOU_ARE_STUNNED; - ItemPrototype const *pProto = pItem->GetProto(); + ItemPrototype const* pProto = pItem->GetProto(); if (pProto) { if (pItem->IsBindedNotWith(this)) @@ -10089,7 +10089,7 @@ InventoryResult Player::CanUseItem(Item *pItem, bool not_loading) const return EQUIP_ERR_ITEM_NOT_FOUND; } -InventoryResult Player::CanUseItem(ItemPrototype const *pProto, bool not_loading) const +InventoryResult Player::CanUseItem(ItemPrototype const* pProto, bool not_loading) const { // Used by group, function NeedBeforeGreed, to know if a prototype can be used by a player @@ -10127,9 +10127,9 @@ InventoryResult Player::CanUseAmmo(uint32 item) const DEBUG_LOG("STORAGE: CanUseAmmo item = %u", item); if (!IsAlive()) return EQUIP_ERR_YOU_ARE_DEAD; - //if( isStunned() ) + //if (isStunned()) // return EQUIP_ERR_YOU_ARE_STUNNED; - ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(item); if (pProto) { if (pProto->InventoryType != INVTYPE_AMMO) @@ -10139,7 +10139,7 @@ InventoryResult Player::CanUseAmmo(uint32 item) const if (msg != EQUIP_ERR_OK) return msg; - /*if( GetReputationMgr().GetReputation() < pProto->RequiredReputation ) + /*if (GetReputationMgr().GetReputation() < pProto->RequiredReputation) return EQUIP_ERR_CANT_EQUIP_REPUTATION; */ @@ -10190,7 +10190,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr) count += itr->count; - Item *pItem = Item::CreateItem(item, count, this); + Item* pItem = Item::CreateItem(item, count, this); if (pItem) { ItemAddedQuestCheck(item, count); @@ -10228,7 +10228,7 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update) } // Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. -Item* Player::_StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool update) +Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update) { if (!pItem) return nullptr; @@ -10238,7 +10238,7 @@ Item* Player::_StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool DEBUG_LOG("STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), count); - Item *pItem2 = GetItemByPos(bag, slot); + Item* pItem2 = GetItemByPos(bag, slot); if (!pItem2) { @@ -10276,7 +10276,7 @@ Item* Player::_StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool pItem->SetState(ITEM_CHANGED, this); } - else if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag)) + else if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag)) { pBag->StoreItem(slot, pItem, update); if (IsInWorld() && update) @@ -10331,7 +10331,7 @@ Item* Player::_StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool Item* Player::EquipNewItem(uint16 pos, uint32 item, bool update) { - if (Item *pItem = Item::CreateItem(item, 1, this)) + if (Item* pItem = Item::CreateItem(item, 1, this)) { ItemAddedQuestCheck(item, 1); return EquipItem(pos, pItem, update); @@ -10340,7 +10340,7 @@ Item* Player::EquipNewItem(uint16 pos, uint32 item, bool update) return nullptr; } -Item* Player::EquipItem(uint16 pos, Item *pItem, bool update) +Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) { AddEnchantmentDurations(pItem); AddItemDurations(pItem); @@ -10348,7 +10348,7 @@ Item* Player::EquipItem(uint16 pos, Item *pItem, bool update) uint8 bag = pos >> 8; uint8 slot = pos & 255; - Item *pItem2 = GetItemByPos(bag, slot); + Item* pItem2 = GetItemByPos(bag, slot); if (!pItem2) { @@ -10356,7 +10356,7 @@ Item* Player::EquipItem(uint16 pos, Item *pItem, bool update) if (IsAlive()) { - ItemPrototype const *pProto = pItem->GetProto(); + ItemPrototype const* pProto = pItem->GetProto(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) @@ -10435,7 +10435,7 @@ Item* Player::EquipItem(uint16 pos, Item *pItem, bool update) return pItem; } -void Player::QuickEquipItem(uint16 pos, Item *pItem) +void Player::QuickEquipItem(uint16 pos, Item* pItem) { if (pItem) { @@ -10453,7 +10453,7 @@ void Player::QuickEquipItem(uint16 pos, Item *pItem) } } -void Player::SetVisibleItemSlot(uint8 slot, Item *pItem) +void Player::SetVisibleItemSlot(uint8 slot, Item* pItem) { if (pItem) { @@ -10484,7 +10484,7 @@ void Player::SetVisibleItemSlot(uint8 slot, Item *pItem) } } -void Player::VisualizeItem(uint8 slot, Item *pItem) +void Player::VisualizeItem(uint8 slot, Item* pItem) { if (!pItem) return; @@ -10515,7 +10515,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) // note2: if removeitem is to be used for delinking // the item must be removed from the player's updatequeue - Item *pItem = GetItemByPos(bag, slot); + Item* pItem = GetItemByPos(bag, slot); if (pItem) { DEBUG_LOG("STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); @@ -10527,7 +10527,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) { if (slot < INVENTORY_SLOT_BAG_END) { - ItemPrototype const *pProto = pItem->GetProto(); + ItemPrototype const* pProto = pItem->GetProto(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) @@ -10558,7 +10558,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) } else { - Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag); + Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag); if (pBag) pBag->RemoveItem(slot, update); } @@ -10612,7 +10612,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool // access to any item pointer referencing the item in this slot can be performed void Player::DestroyItem(uint8 bag, uint8 slot, bool update) { - Item *pItem = GetItemByPos(bag, slot); + Item* pItem = GetItemByPos(bag, slot); if (pItem) { DEBUG_LOG("STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); @@ -10626,7 +10626,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) for (int i = 0; i < MAX_BAG_SIZE; ++i) DestroyItem(slot, i, update); } - else if(!((Bag*)pItem)->IsEmpty()) + else if (!((Bag*)pItem)->IsEmpty()) GetSession()->ProcessAnticheatAction("PassiveAnticheat", "Player::DestroyItem: destroying non equipped bag with items inside!", CHEAT_ACTION_LOG | CHEAT_ACTION_REPORT_GMS); } @@ -10650,7 +10650,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) // equipment and equipped bags can have applied bonuses if (slot < INVENTORY_SLOT_BAG_END) { - ItemPrototype const *pProto = pItem->GetProto(); + ItemPrototype const* pProto = pItem->GetProto(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) @@ -10670,7 +10670,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) m_items[slot] = nullptr; } - else if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag)) + else if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag)) pBag->RemoveItem(slot, update); if (IsInWorld() && update) @@ -10760,7 +10760,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in inventory bags for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) { - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { for (uint32 j = 0; j < pBag->GetBagSize(); ++j) { @@ -10855,7 +10855,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in bank bags for (int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) { - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { for (uint32 j = 0; j < pBag->GetBagSize(); ++j) { @@ -10992,7 +10992,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) uint8 dstbag = dst >> 8; uint8 dstslot = dst & 255; - Item *pSrcItem = GetItemByPos(srcbag, srcslot); + Item* pSrcItem = GetItemByPos(srcbag, srcslot); if (!pSrcItem) { SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pSrcItem, nullptr); @@ -11034,7 +11034,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) } DEBUG_LOG("STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); - Item *pNewItem = pSrcItem->CloneItem(count, this); + Item* pNewItem = pSrcItem->CloneItem(count, this); if (!pNewItem) { SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pSrcItem, nullptr); @@ -11112,8 +11112,8 @@ void Player::SwapItem(uint16 src, uint16 dst) uint8 dstbag = dst >> 8; uint8 dstslot = dst & 255; - Item *pSrcItem = GetItemByPos(srcbag, srcslot); - Item *pDstItem = GetItemByPos(dstbag, dstslot); + Item* pSrcItem = GetItemByPos(srcbag, srcslot); + Item* pDstItem = GetItemByPos(dstbag, dstslot); if (!pSrcItem) return; @@ -11339,7 +11339,7 @@ void Player::SwapItem(uint16 src, uint16 dst) for (uint32 i = 0; i < fullBag->GetBagSize(); ++i) { - Item *bagItem = fullBag->GetItemByPos(i); + Item* bagItem = fullBag->GetItemByPos(i); if (!bagItem) continue; @@ -11365,7 +11365,7 @@ void Player::SwapItem(uint16 src, uint16 dst) count = 0; // will pos in new bag for (uint32 i = 0; i < fullBag->GetBagSize(); ++i) { - Item *bagItem = fullBag->GetItemByPos(i); + Item* bagItem = fullBag->GetItemByPos(i); if (!bagItem) continue; @@ -11441,7 +11441,7 @@ void Player::SwapItem(uint16 src, uint16 dst) AutoUnequipOffhandIfNeed(); } -void Player::AddItemToBuyBackSlot(Item *pItem, uint32 money, ObjectGuid vendorGuid) +void Player::AddItemToBuyBackSlot(Item* pItem, uint32 money, ObjectGuid vendorGuid) { MANGOS_ASSERT(!!pItem); @@ -11519,7 +11519,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) DEBUG_LOG("STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) { - Item *pItem = m_items[slot]; + Item* pItem = m_items[slot]; if (pItem) { pItem->RemoveFromWorld(); @@ -11549,7 +11549,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) } } -void Player::SendEquipError(InventoryResult msg, Item* pItem, Item *pItem2, uint32 itemid /*= 0*/) const +void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint32 itemid /*= 0*/) const { DEBUG_LOG("WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : (msg == EQUIP_ERR_OK ? 1 : 18))); @@ -11660,7 +11660,7 @@ void Player::UpdateEnchantTime(uint32 time) } } -void Player::AddEnchantmentDurations(Item *item) +void Player::AddEnchantmentDurations(Item* item) { for (int x = 0; x < MAX_ENCHANTMENT_SLOT; ++x) { @@ -11673,7 +11673,7 @@ void Player::AddEnchantmentDurations(Item *item) } } -void Player::RemoveEnchantmentDurations(Item *item) +void Player::RemoveEnchantmentDurations(Item* item) { for (EnchantDurationList::iterator itr = m_enchantDuration.begin(); itr != m_enchantDuration.end();) { @@ -11728,7 +11728,7 @@ void Player::RemoveAllEnchantments(EnchantmentSlot slot) } // duration == 0 will remove item enchant -void Player::AddEnchantmentDuration(Item *item, EnchantmentSlot slot, uint32 duration) +void Player::AddEnchantmentDuration(Item* item, EnchantmentSlot slot, uint32 duration) { if (!item) return; @@ -11752,13 +11752,13 @@ void Player::AddEnchantmentDuration(Item *item, EnchantmentSlot slot, uint32 dur } } -void Player::ApplyEnchantment(Item *item, bool apply) +void Player::ApplyEnchantment(Item* item, bool apply) { for (uint32 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot) ApplyEnchantment(item, EnchantmentSlot(slot), apply); } -void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool apply_dur, bool ignore_condition) +void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool apply_dur, bool ignore_condition) { if (!item) return; @@ -11770,7 +11770,7 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool if (!enchant_id) return; - SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); + SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); if (!pEnchant) return; @@ -11916,7 +11916,7 @@ void Player::SendItemDurations() const (*itr)->SendTimeUpdate(this); } -void Player::SendNewItem(Item *item, uint32 count, bool received, bool created, bool broadcast /*=false*/, bool showInChat /*=true*/) +void Player::SendNewItem(Item* item, uint32 count, bool received, bool created, bool broadcast /*=false*/, bool showInChat /*=true*/) { if (!item) // prevent crash return; @@ -11948,7 +11948,7 @@ void Player::SendNewItem(Item *item, uint32 count, bool received, bool created, /*** GOSSIP SYSTEM ***/ /*********************************************************/ -void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) +void Player::PrepareGossipMenu(WorldObject* pSource, uint32 menuId) { PlayerMenu* pMenu = PlayerTalkClass; pMenu->ClearMenus(); @@ -11994,7 +11994,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) if (pSource->GetTypeId() == TYPEID_UNIT) { - Creature *pCreature = (Creature*)pSource; + Creature* pCreature = (Creature*)pSource; uint32 npcflags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS); @@ -12067,7 +12067,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) } else if (pSource->GetTypeId() == TYPEID_GAMEOBJECT) { - GameObject *pGo = (GameObject*)pSource; + GameObject* pGo = (GameObject*)pSource; switch (itr->second.option_id) { @@ -12104,12 +12104,12 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) uint32 idxEntry = MAKE_PAIR32(menuId, itr->second.id); if (!itr->second.OptionBroadcastTextID) - if (GossipMenuItemsLocale const *no = sObjectMgr.GetGossipMenuItemsLocale(idxEntry)) + if (GossipMenuItemsLocale const* no = sObjectMgr.GetGossipMenuItemsLocale(idxEntry)) if (no->OptionText.size() > (size_t)loc_idx && !no->OptionText[loc_idx].empty()) strOptionText = no->OptionText[loc_idx]; if (!itr->second.BoxBroadcastTextID) - if (GossipMenuItemsLocale const *no = sObjectMgr.GetGossipMenuItemsLocale(idxEntry)) + if (GossipMenuItemsLocale const* no = sObjectMgr.GetGossipMenuItemsLocale(idxEntry)) if (no->BoxText.size() > (size_t)loc_idx && !no->BoxText[loc_idx].empty()) strBoxText = no->BoxText[loc_idx]; } @@ -12152,7 +12152,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) }*/ } -void Player::SendPreparedGossip(WorldObject *pSource) +void Player::SendPreparedGossip(WorldObject* pSource) { if (!pSource) return; @@ -12317,7 +12317,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId) } } -uint32 Player::GetGossipTextId(WorldObject *pSource) +uint32 Player::GetGossipTextId(WorldObject* pSource) { if (!pSource || pSource->GetTypeId() != TYPEID_UNIT) return DEFAULT_GOSSIP_MESSAGE; @@ -12363,7 +12363,7 @@ void Player::PrepareQuestMenu(ObjectGuid guid, uint32 exceptQuestId) QuestRelationsMapBounds irbounds; // pets also can have quests - if (Creature *pCreature = GetMap()->GetAnyTypeCreature(guid)) + if (Creature* pCreature = GetMap()->GetAnyTypeCreature(guid)) { rbounds = sObjectMgr.GetCreatureQuestRelationsMapBounds(pCreature->GetEntry()); irbounds = sObjectMgr.GetCreatureQuestInvolvedRelationsMapBounds(pCreature->GetEntry()); @@ -12372,10 +12372,10 @@ void Player::PrepareQuestMenu(ObjectGuid guid, uint32 exceptQuestId) { //we should obtain map pointer from GetMap() in 99% of cases. Special case //only for quests which cast teleport spells on player - Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId()); + Map* _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId()); MANGOS_ASSERT(_map); - if (GameObject *pGameObject = _map->GetGameObject(guid)) + if (GameObject* pGameObject = _map->GetGameObject(guid)) { rbounds = sObjectMgr.GetGOQuestRelationsMapBounds(pGameObject->GetEntry()); irbounds = sObjectMgr.GetGOQuestInvolvedRelationsMapBounds(pGameObject->GetEntry()); @@ -12467,7 +12467,7 @@ void Player::SendPreparedQuest(ObjectGuid guid) std::string title = ""; // need pet case for some quests - if (Creature *pCreature = GetMap()->GetAnyTypeCreature(guid)) + if (Creature* pCreature = GetMap()->GetAnyTypeCreature(guid)) { uint32 textid = sObjectMgr.GetNpcGossip(pCreature->GetGUIDLow()); @@ -12514,20 +12514,20 @@ bool Player::IsCurrentQuest(uint32 quest_id, uint8 completedOrNot) const } } -Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const *pQuest) +Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const* pQuest) { QuestRelationsMapBounds rbounds; - if (Creature *pCreature = GetMap()->GetAnyTypeCreature(guid)) + if (Creature* pCreature = GetMap()->GetAnyTypeCreature(guid)) rbounds = sObjectMgr.GetCreatureQuestRelationsMapBounds(pCreature->GetEntry()); else { //we should obtain map pointer from GetMap() in 99% of cases. Special case //only for quests which cast teleport spells on player - Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId()); + Map* _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId()); MANGOS_ASSERT(_map); - if (GameObject *pGameObject = _map->GetGameObject(guid)) + if (GameObject* pGameObject = _map->GetGameObject(guid)) rbounds = sObjectMgr.GetGOQuestRelationsMapBounds(pGameObject->GetEntry()); else return nullptr; @@ -12548,7 +12548,7 @@ Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const *pQuest) * Basic Quest-taking requirements: Class, Race, Skill, Quest-Line, ... * Check if the quest-level is not too high (related config value CONFIG_INT32_QUEST_HIGH_LEVEL_HIDE_DIFF) */ -bool Player::CanSeeStartQuest(Quest const *pQuest) const +bool Player::CanSeeStartQuest(Quest const* pQuest) const { if (SatisfyQuestClass(pQuest, false) && SatisfyQuestRace(pQuest, false) && SatisfyQuestSkill(pQuest, false) && SatisfyQuestExclusiveGroup(pQuest, false) && SatisfyQuestReputation(pQuest, false) && @@ -12565,7 +12565,7 @@ bool Player::CanSeeStartQuest(Quest const *pQuest) const return false; } -bool Player::CanTakeQuest(Quest const *pQuest, bool msg, bool skipStatusCheck /*false*/) const +bool Player::CanTakeQuest(Quest const* pQuest, bool msg, bool skipStatusCheck /*false*/) const { if (pQuest->GetMaxLevel() && pQuest->GetMaxLevel() < GetLevel()) return false; @@ -12578,7 +12578,7 @@ bool Player::CanTakeQuest(Quest const *pQuest, bool msg, bool skipStatusCheck /* pQuest->IsActive(); } -bool Player::CanAddQuest(Quest const *pQuest, bool msg) const +bool Player::CanAddQuest(Quest const* pQuest, bool msg) const { if (!SatisfyQuestLog(msg)) return false; @@ -12668,7 +12668,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) const return true; } -bool Player::CanCompleteRepeatableQuest(Quest const *pQuest) const +bool Player::CanCompleteRepeatableQuest(Quest const* pQuest) const { // Solve problem that player don't have the quest and try complete it. // if repeatable she must be able to complete event if player don't have it. @@ -12687,7 +12687,7 @@ bool Player::CanCompleteRepeatableQuest(Quest const *pQuest) const return true; } -bool Player::CanRewardQuest(Quest const *pQuest, bool msg) const +bool Player::CanRewardQuest(Quest const* pQuest, bool msg) const { // Prevent packet-editing exploits // Players must meet prereqs for AutoComplete quests @@ -12732,7 +12732,7 @@ bool Player::CanRewardQuest(Quest const *pQuest, bool msg) const return true; } -bool Player::CanRewardQuest(Quest const *pQuest, uint32 reward, bool msg) const +bool Player::CanRewardQuest(Quest const* pQuest, uint32 reward, bool msg) const { // prevent receive reward with quest items in bank or for not completed quest if (!CanRewardQuest(pQuest, msg)) @@ -12811,7 +12811,7 @@ void Player::SendPetTameFailure(PetTameFailureReason reason) const GetSession()->SendPacket(&data); } -void Player::AddQuest(Quest const *pQuest, Object *questGiver) +void Player::AddQuest(Quest const* pQuest, Object* questGiver) { uint16 log_slot = FindQuestSlot(0); MANGOS_ASSERT(log_slot < MAX_QUEST_LOG_SIZE); @@ -12984,7 +12984,7 @@ void Player::FullQuestComplete(uint32 questId) uint32 repValue = pQuest->GetRepObjectiveValue(); uint32 curRep = GetReputationMgr().GetReputation(repFaction); if (curRep < repValue) - if (FactionEntry const *factionEntry = sObjectMgr.GetFactionEntry(repFaction)) + if (FactionEntry const* factionEntry = sObjectMgr.GetFactionEntry(repFaction)) GetReputationMgr().SetReputation(factionEntry, repValue); } @@ -13046,7 +13046,7 @@ void Player::RemoveQuestAtSlot(uint32 slot) if (!TakeOrReplaceQuestStartItems(quest, true, true)) return; - if (const Quest *pQuest = sObjectMgr.GetQuestTemplate(quest)) + if (Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest)) { if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_TIMED)) RemoveTimedQuest(quest); @@ -13059,7 +13059,7 @@ void Player::RemoveQuestAtSlot(uint32 slot) } } -void Player::RewardQuest(Quest const *pQuest, uint32 reward, WorldObject* questEnder, bool announce) +void Player::RewardQuest(Quest const* pQuest, uint32 reward, WorldObject* questEnder, bool announce) { uint32 quest_id = pQuest->GetQuestId(); @@ -13542,7 +13542,7 @@ bool Player::SatisfyQuestNextChain(Quest const* qInfo, bool msg) const // check for all quests further up the chain // only necessary if there are quest chains with more than one quest that can be skipped - //return SatisfyQuestNextChain( qInfo->GetNextQuestInChain(), msg ); + //return SatisfyQuestNextChain(qInfo->GetNextQuestInChain(), msg); return true; } @@ -13567,7 +13567,7 @@ bool Player::SatisfyQuestPrevChain(Quest const* qInfo, bool msg) const // check for all quests further down the chain // only necessary if there are quest chains with more than one quest that can be skipped - //if( !SatisfyQuestPrevChain( prevId, msg ) ) + //if (!SatisfyQuestPrevChain(prevId, msg)) // return false; } @@ -13575,7 +13575,7 @@ bool Player::SatisfyQuestPrevChain(Quest const* qInfo, bool msg) const return true; } -bool Player::CanGiveQuestSourceItemIfNeed(Quest const *pQuest, ItemPosCountVec* dest) const +bool Player::CanGiveQuestSourceItemIfNeed(Quest const* pQuest, ItemPosCountVec* dest) const { if (uint32 srcitem = pQuest->GetSrcItemId()) { @@ -13615,7 +13615,7 @@ bool Player::CanGiveQuestSourceItemIfNeed(Quest const *pQuest, ItemPosCountVec* return true; } -void Player::GiveQuestSourceItemIfNeed(Quest const *pQuest) +void Player::GiveQuestSourceItemIfNeed(Quest const* pQuest) { ItemPosCountVec dest; if (CanGiveQuestSourceItemIfNeed(pQuest, &dest) && !dest.empty()) @@ -13624,7 +13624,7 @@ void Player::GiveQuestSourceItemIfNeed(Quest const *pQuest) for (ItemPosCountVec::const_iterator c_itr = dest.begin(); c_itr != dest.end(); ++c_itr) count += c_itr->count; - Item * item = StoreNewItem(dest, pQuest->GetSrcItemId(), true); + Item* item = StoreNewItem(dest, pQuest->GetSrcItemId(), true); SendNewItem(item, count, true, false); } } @@ -13805,11 +13805,11 @@ void Player::AreaExploredOrEventHappens(uint32 questId) //not used in mangosd, function for external script library void Player::GroupEventHappens(uint32 questId, WorldObject const* pEventObject) { - if (Group *pGroup = GetGroup()) + if (Group* pGroup = GetGroup()) { - for (GroupReference *itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next()) + for (GroupReference* itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next()) { - Player *pGroupGuy = itr->getSource(); + Player* pGroupGuy = itr->getSource(); // for any leave or dead (with not released body) group member at appropriate distance if (pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(pEventObject) && !pGroupGuy->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) @@ -14221,7 +14221,7 @@ bool Player::HasQuestForItem(uint32 itemid) const // examined item is a source item if (qinfo->ReqSourceId[j] == itemid) { - ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemid); // 'unique' item if (pProto->MaxCount && GetItemCount(itemid, true) < pProto->MaxCount) @@ -14254,7 +14254,7 @@ void Player::SendQuestCompleteEvent(uint32 quest_id) const } } -void Player::SendQuestReward(Quest const *pQuest, uint32 XP, Object * questGiver) const +void Player::SendQuestReward(Quest const* pQuest, uint32 XP, Object* questGiver) const { uint32 questid = pQuest->GetQuestId(); DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); @@ -14356,7 +14356,7 @@ void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver) cons } } -void Player::SendPushToPartyResponse(Player *pPlayer, uint8 msg) const +void Player::SendPushToPartyResponse(Player* pPlayer, uint8 msg) const { if (pPlayer) { @@ -14417,7 +14417,7 @@ void Player::_LoadBGData(QueryResult* result) return; // Expecting only one row - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); /* bgInstanceID, bgTeam, x, y, z, o, map */ m_bgData.bgInstanceID = fields[0].GetUInt32(); m_bgData.bgTeam = Team(fields[1].GetUInt32()); @@ -14444,11 +14444,11 @@ bool Player::LoadPositionFromDB(ObjectGuid guid, uint32& mapid, float& x, float& } else { - QueryResult *result = CharacterDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map,taxi_path FROM characters WHERE guid = '%u'", guid.GetCounter()); + QueryResult* result = CharacterDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map,taxi_path FROM characters WHERE guid = '%u'", guid.GetCounter()); if (!result) return false; - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); x = fields[0].GetFloat(); y = fields[1].GetFloat(); @@ -14478,7 +14478,7 @@ void Player::_LoadIntoDataField(const char* data, uint32 startOffset, uint32 cou m_uint32Values[startOffset + index] = atol((*iter).c_str()); } -bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder *holder) +bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder) { // 0 1 2 3 4 5 6 7 8 9 10 11 //SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, @@ -14493,7 +14493,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder *holder) // 57 58 //"world_phase_mask FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid)); - QueryResult *result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM); + QueryResult* result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM); if (!result) { @@ -14501,7 +14501,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder *holder) return false; } - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 dbAccountId = fields[1].GetUInt32(); @@ -15166,7 +15166,7 @@ bool Player::IsAllowedToLoot(Creature const* creature) return false; } -void Player::_LoadAuras(QueryResult *result, uint32 timediff) +void Player::_LoadAuras(QueryResult* result, uint32 timediff) { //RemoveAllAuras(); -- some spells casted before aura load, for example in LoadSkills, aura list explicitly cleaned early @@ -15174,13 +15174,13 @@ void Player::_LoadAuras(QueryResult *result, uint32 timediff) for (int i = UNIT_FIELD_AURA; i <= UNIT_FIELD_AURASTATE; ++i) SetUInt32Value(i, 0); - //QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,item_guid,spell,stackcount,remaincharges,basepoints0,basepoints1,basepoints2,periodictime0,periodictime1,periodictime2,maxduration,remaintime,effIndexMask FROM character_aura WHERE guid = '%u'",GetGUIDLow()); + //QueryResult* result = CharacterDatabase.PQuery("SELECT caster_guid,item_guid,spell,stackcount,remaincharges,basepoints0,basepoints1,basepoints2,periodictime0,periodictime1,periodictime2,maxduration,remaintime,effIndexMask FROM character_aura WHERE guid = '%u'",GetGUIDLow()); if (result) { do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); AuraSaveStruct s; s.caster_guid = ObjectGuid(fields[0].GetUInt64()); s.item_lowguid = fields[1].GetUInt32(); @@ -15251,7 +15251,7 @@ void Player::LoadAura(AuraSaveStruct& s, uint32 timediff) else if (!s.stackcount) s.stackcount = 1; - SpellAuraHolder *holder = CreateSpellAuraHolder(spellproto, this, nullptr, nullptr); + SpellAuraHolder* holder = CreateSpellAuraHolder(spellproto, this, nullptr, nullptr); holder->SetLoadedState(s.caster_guid, ObjectGuid(HIGHGUID_ITEM, s.item_lowguid), s.stackcount, s.remaincharges, s.maxduration, s.remaintime); for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) @@ -15287,7 +15287,7 @@ void Player::LoadCorpse() sObjectAccessor.ConvertCorpseForPlayer(GetObjectGuid()); else { - if (Corpse *corpse = GetCorpse()) + if (Corpse* corpse = GetCorpse()) ApplyModByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER, corpse && !sMapStorage.LookupEntry(corpse->GetMapId())->Instanceable()); else { @@ -15297,7 +15297,7 @@ void Player::LoadCorpse() } } -void Player::_LoadInventory(QueryResult *result, uint32 timediff, bool &has_epic_mount) +void Player::_LoadInventory(QueryResult* result, uint32 timediff, bool &has_epic_mount) { // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 //SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, text, bag, slot, item, itemEntry, generated_loot @@ -15318,13 +15318,13 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff, bool &has_epic m_itemUpdateQueueBlocked = true; do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 bag_guid = fields[10].GetUInt32(); uint8 slot = fields[11].GetUInt8(); uint32 item_lowguid = fields[12].GetUInt32(); uint32 item_id = fields[13].GetUInt32(); - ItemPrototype const * proto = ObjectMgr::GetItemPrototype(item_id); + ItemPrototype const* proto = ObjectMgr::GetItemPrototype(item_id); if (!proto) { @@ -15341,7 +15341,7 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff, bool &has_epic // Duplicate check. Player listed item in AH and then immediately relogged, before the item // was deleted from the inventory in the DB - if (Item *item = sAuctionMgr.GetAItem(item_lowguid)) + if (Item* item = sAuctionMgr.GetAItem(item_lowguid)) { std::stringstream oss; oss << "Duplicate item (via AH) " << item_id << " GUID:" << item_lowguid << ", count: " << item->GetCount() << ", bag: " << bag_guid << ", slot: " << uint32(slot); @@ -15351,7 +15351,7 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff, bool &has_epic continue; } - Item *item = NewItemOrBag(proto); + Item* item = NewItemOrBag(proto); /* * LoadFromDB is called from multiple places but with a different set of fields - this is workaround @@ -15512,19 +15512,19 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff, bool &has_epic } } - //if(IsAlive()) + //if (IsAlive()) _ApplyAllItemMods(); } -void Player::_LoadItemLoot(QueryResult *result) +void Player::_LoadItemLoot(QueryResult* result) { - //QueryResult *result = CharacterDatabase.PQuery("SELECT guid,itemid,amount,property FROM item_loot WHERE guid = '%u'", GetGUIDLow()); + //QueryResult* result = CharacterDatabase.PQuery("SELECT guid,itemid,amount,property FROM item_loot WHERE guid = '%u'", GetGUIDLow()); if (result) { do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 item_guid = fields[0].GetUInt32(); Item* item = GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, item_guid)); @@ -15549,26 +15549,26 @@ void Player::LoadPet() // just not added to the map if (IsInWorld()) { - Pet *pet = new Pet; + Pet* pet = new Pet; if (!pet->LoadPetFromDB(this, 0, 0, true)) delete pet; } } -void Player::_LoadQuestStatus(QueryResult *result) +void Player::_LoadQuestStatus(QueryResult* result) { mQuestStatus.clear(); uint32 slot = 0; //// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 - //QueryResult *result = CharacterDatabase.PQuery("SELECT quest, status, rewarded, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, reward_choice FROM character_queststatus WHERE guid = '%u'", GetGUIDLow()); + //QueryResult* result = CharacterDatabase.PQuery("SELECT quest, status, rewarded, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, reward_choice FROM character_queststatus WHERE guid = '%u'", GetGUIDLow()); if (result) { do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 quest_id = fields[0].GetUInt32(); // used to be new, no delete? @@ -15657,15 +15657,15 @@ void Player::_LoadQuestStatus(QueryResult *result) SetQuestSlot(i, 0); } -void Player::_LoadSpells(QueryResult *result) +void Player::_LoadSpells(QueryResult* result) { - //QueryResult *result = CharacterDatabase.PQuery("SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'",GetGUIDLow()); + //QueryResult* result = CharacterDatabase.PQuery("SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'",GetGUIDLow()); if (result) { do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 spell_id = fields[0].GetUInt32(); @@ -15675,9 +15675,9 @@ void Player::_LoadSpells(QueryResult *result) } } -void Player::_LoadGroup(QueryResult *result) +void Player::_LoadGroup(QueryResult* result) { - //QueryResult *result = CharacterDatabase.PQuery("SELECT groupId FROM group_member WHERE memberGuid='%u'", GetGUIDLow()); + //QueryResult* result = CharacterDatabase.PQuery("SELECT groupId FROM group_member WHERE memberGuid='%u'", GetGUIDLow()); if (result) { uint32 groupId = (*result)[0].GetUInt32(); @@ -15691,18 +15691,18 @@ void Player::_LoadGroup(QueryResult *result) UpdateGroupLeaderFlag(); } -void Player::_LoadBoundInstances(QueryResult *result) +void Player::_LoadBoundInstances(QueryResult* result) { m_boundInstances.clear(); - Group *group = GetGroup(); + Group* group = GetGroup(); - //QueryResult *result = CharacterDatabase.PQuery("SELECT id, permanent, map, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid)); + //QueryResult* result = CharacterDatabase.PQuery("SELECT id, permanent, map, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid)); if (result) { do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); bool perm = fields[1].GetBool(); uint32 mapId = fields[2].GetUInt32(); uint32 instanceId = fields[0].GetUInt32(); @@ -15729,7 +15729,7 @@ void Player::_LoadBoundInstances(QueryResult *result) } // since non permanent binds are always solo bind, they can always be reset - DungeonPersistentState *state = (DungeonPersistentState*)sMapPersistentStateMgr.AddPersistentState(mapEntry, instanceId, resetTime, !perm, true); + DungeonPersistentState* state = (DungeonPersistentState*)sMapPersistentStateMgr.AddPersistentState(mapEntry, instanceId, resetTime, !perm, true); if (state) BindToInstance(state, perm, true); } while (result->NextRow()); @@ -15763,7 +15763,7 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, bool unload) } } -InstancePlayerBind* Player::BindToInstance(DungeonPersistentState *state, bool permanent, bool load) +InstancePlayerBind* Player::BindToInstance(DungeonPersistentState* state, bool permanent, bool load) { if (state) { @@ -15812,14 +15812,14 @@ DungeonPersistentState* Player::GetBoundInstanceSaveForSelfOrGroup(uint32 mapid) if (!mapEntry) return nullptr; - InstancePlayerBind *pBind = GetBoundInstance(mapid); - DungeonPersistentState *state = pBind ? pBind->state : nullptr; + InstancePlayerBind* pBind = GetBoundInstance(mapid); + DungeonPersistentState* state = pBind ? pBind->state : nullptr; // the player's permanent player bind is taken into consideration first // then the player's group bind and finally the solo bind. if (!pBind || !pBind->perm) { - if (Group *group = GetGroup()) + if (Group* group = GetGroup()) if (InstanceGroupBind* groupBind = group->GetBoundInstance(mapid)) state = groupBind->state; } @@ -15840,7 +15840,7 @@ void Player::SendRaidInfo() const { if (itr->second.perm) { - DungeonPersistentState *state = itr->second.state; + DungeonPersistentState* state = itr->second.state; data << uint32(state->GetMapId()); // map id // Permanent dungeons (raids) don't have a valid reset timer since it's @@ -15896,7 +15896,7 @@ void Player::SendSavedInstances() const } /// convert the player's binds to the group -void Player::ConvertInstancesToGroup(Player *player, Group *group, ObjectGuid player_guid) +void Player::ConvertInstancesToGroup(Player* player, Group* group, ObjectGuid player_guid) { bool has_binds = false; bool has_solo = false; @@ -15945,9 +15945,9 @@ void Player::ConvertInstancesToGroup(Player *player, Group *group, ObjectGuid pl CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%u' AND permanent = 0", player_lowguid); } -bool Player::_LoadHomeBind(QueryResult *result) +bool Player::_LoadHomeBind(QueryResult* result) { - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(GetRace(), GetClass()); + PlayerInfo const* info = sObjectMgr.GetPlayerInfo(GetRace(), GetClass()); if (!info) { sLog.outError("Player have incorrect race/class pair. Can't be loaded."); @@ -15955,10 +15955,10 @@ bool Player::_LoadHomeBind(QueryResult *result) } bool ok = false; - //QueryResult *result = CharacterDatabase.PQuery("SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(playerGuid)); + //QueryResult* result = CharacterDatabase.PQuery("SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(playerGuid)); if (result) { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); m_homebindMapId = fields[0].GetUInt32(); m_homebindAreaId = fields[1].GetUInt16(); m_homebindX = fields[2].GetFloat(); @@ -15998,7 +15998,7 @@ void Player::_LoadGuild(QueryResult* result) if (result) { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); SetInGuild(fields[0].GetUInt32()); SetRank(fields[1].GetUInt32()); } @@ -16272,7 +16272,7 @@ void Player::_SaveAuras() AuraSaveStruct s; for (SpellAuraHolderMap::const_iterator itr = auraHolders.begin(); itr != auraHolders.end(); ++itr) { - SpellAuraHolder *holder = itr->second; + SpellAuraHolder* holder = itr->second; if (!SaveAura(holder, s)) continue; @@ -16314,7 +16314,7 @@ bool Player::SaveAura(SpellAuraHolder* holder, AuraSaveStruct& saveStruct) saveStruct.damage[i] = 0; saveStruct.periodicTime[i] = 0; - if (Aura *aur = holder->GetAuraByEffectIndex(SpellEffectIndex(i))) + if (Aura* aur = holder->GetAuraByEffectIndex(SpellEffectIndex(i))) { // don't save not own area auras if (aur->IsAreaAura() && holder->GetCasterGuid() != GetObjectGuid()) @@ -16349,7 +16349,7 @@ void Player::_SaveInventory() // and remove those that aren't already for (uint8 i = BUYBACK_SLOT_START; i < BUYBACK_SLOT_END; ++i) { - Item *item = m_items[i]; + Item* item = m_items[i]; if (!item || item->GetState() == ITEM_NEW) continue; static SqlStatementID delInv ; @@ -16373,7 +16373,7 @@ void Player::_SaveInventory() for (size_t i = 0; i < m_itemUpdateQueue.size(); ++i) { - Item *item = m_itemUpdateQueue[i]; + Item* item = m_itemUpdateQueue[i]; if (!item) continue; @@ -16381,7 +16381,7 @@ void Player::_SaveInventory() if (item->GetState() != ITEM_REMOVED) { // Plusieurs tests anti dupli ... - Item *test = GetItemByPos(item->GetBagSlot(), item->GetSlot()); + Item* test = GetItemByPos(item->GetBagSlot(), item->GetSlot()); if (test == nullptr) { @@ -16415,7 +16415,7 @@ void Player::_SaveInventory() static SqlStatementID updateInventory ; static SqlStatementID deleteInventory ; - Bag *container = item->GetContainer(); + Bag* container = item->GetContainer(); uint32 bag_guid = container ? container->GetGUIDLow() : 0; switch (item->GetState()) @@ -16781,8 +16781,8 @@ void Player::ResetInstances(InstanceResetMethod method) for (BoundInstancesMap::iterator itr = m_boundInstances.begin(); itr != m_boundInstances.end();) { - DungeonPersistentState *state = itr->second.state; - const MapEntry *entry = sMapStorage.LookupEntry(itr->first); + DungeonPersistentState* state = itr->second.state; + MapEntry const* entry = sMapStorage.LookupEntry(itr->first); if (!entry || !state->CanReset()) { ++itr; @@ -16800,7 +16800,7 @@ void Player::ResetInstances(InstanceResetMethod method) } // if the map is loaded, reset it - if (Map *map = sMapMgr.FindMap(state->GetMapId(), state->GetInstanceId())) + if (Map* map = sMapMgr.FindMap(state->GetMapId(), state->GetInstanceId())) if (map->IsDungeon()) ((DungeonMap*)map)->Reset(method); @@ -16888,7 +16888,7 @@ bool Player::IsInInterFactionMode() const if (IsFFAPvP()) return true; - Map * tMap = FindMap(); + Map* tMap = FindMap(); if ((tMap != nullptr) && (tMap->IsDungeon())) return true; @@ -16977,7 +16977,7 @@ void Player::PetSpellInitialize() DEBUG_LOG("Pet Spells Groups"); - CharmInfo *charmInfo = pet->GetCharmInfo(); + CharmInfo* charmInfo = pet->GetCharmInfo(); WorldPacket data(SMSG_PET_SPELLS, 8 + 4 + 1 + 1 + 2 + 4 * MAX_UNIT_ACTION_BAR_INDEX + 1 + 1); data << pet->GetObjectGuid(); @@ -17021,7 +17021,7 @@ void Player::PossessSpellInitialize() if (!charm) return; - CharmInfo *charmInfo = charm->GetCharmInfo(); + CharmInfo* charmInfo = charm->GetCharmInfo(); if (!charmInfo) { @@ -17049,7 +17049,7 @@ void Player::CharmSpellInitialize() if (!charm) return; - CharmInfo *charmInfo = charm->GetCharmInfo(); + CharmInfo* charmInfo = charm->GetCharmInfo(); if (!charmInfo) { sLog.outError("Player::CharmSpellInitialize(): the player's charm (GUID: %u TypeId: %u) has no charminfo!", charm->GetGUIDLow(), charm->GetTypeId()); @@ -17060,7 +17060,7 @@ void Player::CharmSpellInitialize() if (charm->GetTypeId() != TYPEID_PLAYER) { - CreatureInfo const *cinfo = ((Creature*)charm)->GetCreatureInfo(); + CreatureInfo const* cinfo = ((Creature*)charm)->GetCreatureInfo(); if (cinfo && cinfo->type == CREATURE_TYPE_DEMON && GetClass() == CLASS_WARLOCK) { @@ -17086,7 +17086,7 @@ void Player::CharmSpellInitialize() { for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i) { - CharmSpellEntry *cspell = charmInfo->GetCharmSpell(i); + CharmSpellEntry* cspell = charmInfo->GetCharmSpell(i); if (cspell->GetAction()) data << uint32(cspell->packedData); } @@ -17165,7 +17165,7 @@ void Player::UnsummonPossessedMinion() pMinion->DoKillUnit(); } -bool Player::HasInstantCastingSpellMod(SpellEntry const *spellInfo) const +bool Player::HasInstantCastingSpellMod(SpellEntry const* spellInfo) const { for (const auto& mod : m_spellMods[SPELLMOD_CASTING_TIME]) { @@ -17175,7 +17175,7 @@ bool Player::HasInstantCastingSpellMod(SpellEntry const *spellInfo) const return false; } -bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mod, Spell* spell) const +bool Player::IsAffectedBySpellmod(SpellEntry const* spellInfo, SpellModifier* mod, Spell* spell) const { if (!mod || !spellInfo) return false; @@ -17361,13 +17361,13 @@ void Player::RemovePetitionsAndSigns(ObjectGuid guid) // Blocking query, can cause lag at character deletion if MySQL table is locked. /* - QueryResult *result = CharacterDatabase.PQuery("SELECT ownerguid,petitionguid FROM petition_sign WHERE playerguid = '%u'", lowguid); + QueryResult* result = CharacterDatabase.PQuery("SELECT ownerguid,petitionguid FROM petition_sign WHERE playerguid = '%u'", lowguid); if (result) { do // this part effectively does nothing, since the deletion / modification only takes place _after_ the PetitionQuery. Though I don't know if the result remains intact if I execute the delete query beforehand. { // and SendPetitionQueryOpcode reads data from the DB - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); ObjectGuid ownerguid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()); ObjectGuid petitionguid = ObjectGuid(HIGHGUID_ITEM, fields[1].GetUInt32()); @@ -17907,14 +17907,14 @@ bool Player::BuyItemFromVendor(ObjectGuid vendorGuid, uint32 item, uint8 count, if (!IsAlive()) return false; - ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(item); if (!pProto) { SendBuyError(BUY_ERR_CANT_FIND_ITEM, nullptr, item, 0); return false; } - Creature *pCreature = GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_VENDOR); + Creature* pCreature = GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_VENDOR); if (!pCreature) { DEBUG_LOG("WORLD: BuyItemFromVendor - %s not found or you can't interact with him.", vendorGuid.GetString().c_str()); @@ -18208,8 +18208,8 @@ void Player::SetBattleGroundEntryPoint(Player* leader /*= nullptr*/, bool queued void Player::LeaveBattleground(bool teleportToEntryPoint) { - //ClearUpdateMask( true ); - if (BattleGround *bg = GetBattleGround()) + //ClearUpdateMask(true); + if (BattleGround* bg = GetBattleGround()) { // nor more Waiting to Resurrect RemoveAurasDueToSpell(2584); @@ -18264,7 +18264,7 @@ bool Player::IsVisibleInGridForPlayer(Player const* pl) const // Dead player see live players near own corpse if (IsAlive()) { - Corpse *corpse = pl->GetCorpse(); + Corpse* corpse = pl->GetCorpse(); if (corpse) { // 20 - aggro distance for same level, 25 - max additional distance if player level less that creature level @@ -18485,7 +18485,7 @@ void Player::InitPrimaryProfessions() void Player::SetComboPoints() { - Unit *combotarget = ObjectAccessor::GetUnit(*this, m_comboTargetGuid); + Unit* combotarget = ObjectAccessor::GetUnit(*this, m_comboTargetGuid); if (combotarget) { SetGuidValue(PLAYER_FIELD_COMBO_TARGET, combotarget->GetObjectGuid()); @@ -18546,7 +18546,7 @@ void Player::ClearComboPoints() m_comboTargetGuid.Clear(); } -void Player::SetGroup(Group *group, int8 subgroup) +void Player::SetGroup(Group* group, int8 subgroup) { if (group == nullptr) m_group.unlink(); @@ -18642,7 +18642,7 @@ void Player::SendUpdateToOutOfRangeGroupMembers() m_groupUpdateMask = GROUP_UPDATE_FLAG_NONE; m_auraUpdateMask = 0; - if (Pet *pet = GetPet()) + if (Pet* pet = GetPet()) pet->ResetAuraUpdateMask(); } @@ -18674,7 +18674,7 @@ void Player::SendInstanceResetWarning(uint32 mapid, uint32 _time) const #endif } -void Player::ApplyEquipCooldown(Item * pItem) +void Player::ApplyEquipCooldown(Item* pItem) { if (pItem->GetProto()->Flags & ITEM_FLAG_NO_EQUIP_COOLDOWN) return; @@ -18725,7 +18725,7 @@ void Player::ResetSpells() void Player::LearnDefaultSpells() { // learn default race/class spells - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(GetRace(), GetClass()); + PlayerInfo const* info = sObjectMgr.GetPlayerInfo(GetRace(), GetClass()); if (!info) return; @@ -18748,7 +18748,7 @@ void Player::LearnQuestRewardedSpells(Quest const* quest) if (!spell_id) return; - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spell_id); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(spell_id); if (!spellInfo) return; @@ -18776,7 +18776,7 @@ void Player::LearnQuestRewardedSpells(Quest const* quest) if (!HasSpell(first_spell)) return; - SpellEntry const *learnedInfo = sSpellMgr.GetSpellEntry(learned_0); + SpellEntry const* learnedInfo = sSpellMgr.GetSpellEntry(learned_0); if (!learnedInfo) return; @@ -18789,7 +18789,7 @@ void Player::LearnQuestRewardedSpells(Quest const* quest) if (itr->second.state == PLAYERSPELL_REMOVED || itr->first == learned_0) continue; - SpellEntry const *itrInfo = sSpellMgr.GetSpellEntry(itr->first); + SpellEntry const* itrInfo = sSpellMgr.GetSpellEntry(itr->first); if (!itrInfo) return; @@ -18859,7 +18859,7 @@ BattleGround* Player::GetBattleGround() const bool Player::GetBGAccessByLevel(BattleGroundTypeId bgTypeId) const { // get a template bg instead of running one - BattleGround *bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId); + BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId); if (!bg) return false; @@ -18879,7 +18879,7 @@ uint32 Player::GetMinLevelForBattleGroundBracketId(BattleGroundBracketId bracket if (bracket_id > BG_BRACKET_ID_LAST) bracket_id = BG_BRACKET_ID_LAST; - BattleGround *bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId); + BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId); ASSERT(bg); if (bgTypeId == BATTLEGROUND_AB) return 10 * bracket_id + bg->GetMinLevel() - 10; @@ -18899,7 +18899,7 @@ uint32 Player::GetMaxLevelForBattleGroundBracketId(BattleGroundBracketId bracket BattleGroundBracketId Player::GetBattleGroundBracketIdFromLevel(BattleGroundTypeId bgTypeId) const { - BattleGround *bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId); + BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId); ASSERT(bg); if (GetLevel() < bg->GetMinLevel()) @@ -19057,7 +19057,7 @@ void Player::UpdateForQuestWorldObjects() { if (itr->IsGameObject()) { - if (GameObject *obj = GetMap()->GetGameObject(*itr)) + if (GameObject* obj = GetMap()->GetGameObject(*itr)) if (!obj->IsTransport()) if (m_visibleGobjQuestActivated[obj->GetObjectGuid()] != obj->ActivateToQuest(this)) { @@ -19092,7 +19092,7 @@ void Player::SummonIfPossible(bool agree) // drop flag at summon // this code can be reached only when GM is summoning player who carries flag, because player should be immune to summoning spells when he carries flag - if (BattleGround *bg = GetBattleGround()) + if (BattleGround* bg = GetBattleGround()) bg->EventPlayerDroppedFlag(this); m_summon_expire = 0; @@ -19100,7 +19100,7 @@ void Player::SummonIfPossible(bool agree) TeleportTo(m_summon_mapid, m_summon_x, m_summon_y, m_summon_z, GetOrientation()); } -void Player::RemoveItemDurations(Item *item) +void Player::RemoveItemDurations(Item* item) { for (ItemDurationList::iterator itr = m_itemDuration.begin(); itr != m_itemDuration.end(); ++itr) { @@ -19112,7 +19112,7 @@ void Player::RemoveItemDurations(Item *item) } } -void Player::AddItemDurations(Item *item) +void Player::AddItemDurations(Item* item) { if (item->GetUInt32Value(ITEM_FIELD_DURATION)) { @@ -19147,7 +19147,7 @@ void Player::AutoUnequipOffhandIfNeed() void Player::AutoUnequipItemFromSlot(uint32 slot) { - Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); if (!pItem) return; @@ -19171,7 +19171,7 @@ void Player::AutoUnequipItemFromSlot(uint32 slot) } } -ZoneScript * Player::GetZoneScript() const +ZoneScript* Player::GetZoneScript() const { return sZoneScriptMgr.GetZoneScriptToZoneId(GetZoneId()); } @@ -19188,7 +19188,7 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons case ITEM_CLASS_WEAPON: { for (int i = EQUIPMENT_SLOT_MAINHAND; i < EQUIPMENT_SLOT_TABARD; ++i) - if (Item *item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (item != ignoreItem && item->IsFitToSpellRequirements(spellInfo) && !item->IsBroken()) return true; break; @@ -19197,17 +19197,17 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons { // tabard not have dependent spells for (int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_MAINHAND; ++i) - if (Item *item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (item != ignoreItem && item->IsFitToSpellRequirements(spellInfo) && !item->IsBroken()) return true; // shields can be equipped to offhand slot - if (Item *item = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) if (item != ignoreItem && item->IsFitToSpellRequirements(spellInfo) && !item->IsBroken()) return true; // ranged slot can have some armor subclasses - if (Item *item = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED)) if (item != ignoreItem && item->IsFitToSpellRequirements(spellInfo) && !item->IsBroken()) return true; @@ -19221,7 +19221,7 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons return false; } -void Player::RemoveItemDependentAurasAndCasts(Item * pItem) +void Player::RemoveItemDependentAurasAndCasts(Item* pItem) { ItemPrototype const* itemProto = pItem->GetProto(); // Nostalrius: certains items ne retirent pas de buff. @@ -19385,9 +19385,9 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar ObjectGuid creature_guid = pRewardSource->GetTypeId() == TYPEID_UNIT ? pRewardSource->GetObjectGuid() : ObjectGuid(); // prepare data for near group iteration - if (Group *pGroup = GetGroup()) + if (Group* pGroup = GetGroup()) { - for (GroupReference *itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next()) + for (GroupReference* itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next()) { Player* pGroupGuy = itr->getSource(); if (!pGroupGuy) @@ -19408,9 +19408,9 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar void Player::RewardPlayerAndGroupAtCast(WorldObject* pRewardSource, uint32 spellid) { // prepare data for near group iteration - if (Group *pGroup = GetGroup()) + if (Group* pGroup = GetGroup()) { - for (GroupReference *itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next()) + for (GroupReference* itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next()) { Player* pGroupGuy = itr->getSource(); if (!pGroupGuy) @@ -19639,14 +19639,14 @@ void Player::SendCorpseReclaimDelay(bool load) const Player* Player::GetNextRandomRaidMember(float radius) { - Group *pGroup = GetGroup(); + Group* pGroup = GetGroup(); if (!pGroup) return nullptr; std::vector nearMembers; nearMembers.reserve(pGroup->GetMembersCount()); - for (GroupReference *itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next()) + for (GroupReference* itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next()) { Player* Target = itr->getSource(); @@ -19669,7 +19669,7 @@ PartyResult Player::CanUninviteFromGroup(ObjectGuid uninvitedGuid) const if (!grp) return ERR_NOT_IN_GROUP; - if(grp->GetLeaderGuid() == uninvitedGuid) // prevent assists kicking leader + if (grp->GetLeaderGuid() == uninvitedGuid) // prevent assists kicking leader return ERR_NOT_LEADER; if (!grp->IsLeader(GetObjectGuid()) && !grp->IsAssistant(GetObjectGuid())) @@ -19715,7 +19715,7 @@ void Player::RemoveFromBattleGroundRaid() SetOriginalGroup(nullptr); } -void Player::SetOriginalGroup(Group *group, int8 subgroup) +void Player::SetOriginalGroup(Group* group, int8 subgroup) { if (group == nullptr) m_originalGroup.unlink(); @@ -19842,7 +19842,7 @@ bool Player::CanUseBattleGroundObject() const return false; // TODO : some spells gives player ForceReaction to one faction (ReputationMgr::ApplyForceReaction) // maybe gameobject code should handle that ForceReaction usage - return ( //InBattleGround() && // in battleground - not need, check in other cases + return (//InBattleGround() && // in battleground - not need, check in other cases !IsMounted() && //player cannot use object when he is invulnerable (immune) !IsTotalImmune() && // not totally immune @@ -19918,7 +19918,7 @@ void Player::LearnSpellHighRank(uint32 spellid) sSpellMgr.doForHighRanks(spellid, worker); } -void Player::_LoadSkills(QueryResult *result) +void Player::_LoadSkills(QueryResult* result) { // 0 1 2 // SetPQuery(PLAYER_LOGIN_QUERY_LOADSKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = '%u'", GUID_LOPART(m_guid)); @@ -19928,13 +19928,13 @@ void Player::_LoadSkills(QueryResult *result) { do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint16 skill = fields[0].GetUInt16(); uint16 value = fields[1].GetUInt16(); uint16 max = fields[2].GetUInt16(); - SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(skill); + SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill); if (!pSkill) { sLog.outError("Character %u has skill %u that does not exist.", GetGUIDLow(), skill); @@ -19988,7 +19988,7 @@ void Player::_LoadSkills(QueryResult *result) } #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_10_2 -void Player::_LoadForgottenSkills(QueryResult *result) +void Player::_LoadForgottenSkills(QueryResult* result) { // 0 1 // SetPQuery(PLAYER_LOGIN_QUERY_FORGOTTEN_SKILLS, "SELECT skill, value FROM character_forgotten_skills WHERE guid = '%u'", GUID_LOPART(m_guid)); @@ -19997,12 +19997,12 @@ void Player::_LoadForgottenSkills(QueryResult *result) { do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint16 skill = fields[0].GetUInt16(); uint16 value = fields[1].GetUInt16(); - SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(skill); + SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill); if (!pSkill) { sLog.outError("Character %u has saved value for forgotten skill %u that does not exist.", GetGUIDLow(), skill); @@ -20397,7 +20397,7 @@ bool Player::TeleportToHomebind(uint32 options, bool hearthCooldown) if (hearthCooldown) { // Initiate hearthstone cooldown - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(8690); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(8690); AddSpellAndCategoryCooldowns(spellInfo, 6948); } return TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation(), (options | TELE_TO_FORCE_MAP_CHANGE)); @@ -20489,7 +20489,7 @@ void Player::SetControlledBy(Unit* pWho) bool Player::ChangeRace(uint8 newRace) { - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(newRace, GetClass()); + PlayerInfo const* info = sObjectMgr.GetPlayerInfo(newRace, GetClass()); if (!info) return false; @@ -20640,7 +20640,7 @@ bool Player::ChangeSpellsForRace(uint8 oldRace, uint8 newRace) } } - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(oldRace, GetClass()); + PlayerInfo const* info = sObjectMgr.GetPlayerInfo(oldRace, GetClass()); ASSERT(info); for (PlayerCreateInfoSpells::const_iterator itr = info->spell.begin(); itr != info->spell.end(); ++itr) { @@ -20727,7 +20727,7 @@ bool Player::ChangeItemsForRace(uint8 oldRace, uint8 newRace) //std::map addItems; for (int i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i) { - if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { // Item deja gere ? (ObjectMgr) bool previouslyHandled = false; @@ -20743,7 +20743,7 @@ bool Player::ChangeItemsForRace(uint8 oldRace, uint8 newRace) if (previouslyHandled) continue; - ItemPrototype const * pProto = pItem->GetProto(); + ItemPrototype const* pProto = pItem->GetProto(); bool canEquip = true; uint32 raceMask = (1 << (newRace - 1)); @@ -20956,7 +20956,7 @@ bool Player::ChangeQuestsForRace(uint8 oldRace, uint8 newRace) return true; } -bool Player::IsImmuneToSpellEffect(SpellEntry const *spellInfo, SpellEffectIndex index, bool castOnSelf) const +bool Player::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index, bool castOnSelf) const { if (HasCheatOption(PLAYER_CHEAT_IMMUNE_AURA) && spellInfo->EffectApplyAuraName[index] && !spellInfo->IsPositiveEffect(index)) return true; @@ -21052,7 +21052,7 @@ void Player::InterruptSpellsWithCastItem(Item* item) { // Interrupt current spells for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++) - if (Spell *spell = GetCurrentSpell(CurrentSpellTypes(i))) + if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i))) if (spell->m_CastItem == item) { spell->ClearCastItem(); diff --git a/src/game/Objects/Player.h b/src/game/Objects/Player.h index 301bd2cc6..f62d96c30 100644 --- a/src/game/Objects/Player.h +++ b/src/game/Objects/Player.h @@ -895,13 +895,13 @@ class MANGOS_DLL_SPEC Player final: public Unit uint16 m_cheatOptions; public: bool IsAcceptTickets() const { return GetSession()->GetSecurity() >= SEC_GAMEMASTER && (m_ExtraFlags & PLAYER_EXTRA_GM_ACCEPT_TICKETS); } - void SetAcceptTicket(bool on) { if(on) m_ExtraFlags |= PLAYER_EXTRA_GM_ACCEPT_TICKETS; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_ACCEPT_TICKETS; } + void SetAcceptTicket(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_ACCEPT_TICKETS; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_ACCEPT_TICKETS; } bool IsGameMaster() const { return m_ExtraFlags & PLAYER_EXTRA_GM_ON; } void SetGameMaster(bool on, bool notify = false); bool IsGMChat() const { return GetSession()->GetSecurity() >= SEC_MODERATOR && (m_ExtraFlags & PLAYER_EXTRA_GM_CHAT); } void SetGMChat(bool on, bool notify = false); bool IsTaxiCheater() const { return m_ExtraFlags & PLAYER_EXTRA_TAXICHEAT; } - void SetTaxiCheater(bool on) { if(on) m_ExtraFlags |= PLAYER_EXTRA_TAXICHEAT; else m_ExtraFlags &= ~PLAYER_EXTRA_TAXICHEAT; } + void SetTaxiCheater(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_TAXICHEAT; else m_ExtraFlags &= ~PLAYER_EXTRA_TAXICHEAT; } void SetPvPDeath(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_PVP_DEATH; else m_ExtraFlags &= ~PLAYER_EXTRA_PVP_DEATH; } bool IsGMVisible() const { return !(m_ExtraFlags & PLAYER_EXTRA_GM_INVISIBLE); } void SetGMVisible(bool on, bool notify = false); @@ -1015,7 +1015,7 @@ class MANGOS_DLL_SPEC Player final: public Unit } InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap = false) const { - if(!pItem) + if (!pItem) return EQUIP_ERR_ITEM_NOT_FOUND; uint32 count = pItem->GetCount(); return _CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, nullptr); @@ -2534,11 +2534,11 @@ template T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas else if (mod->type == SPELLMOD_PCT) { // skip percent mods for null basevalue (most important for spell mods with charges) - if(basevalue == T(0)) + if (basevalue == T(0)) continue; // special case (skip >10sec spell casts for instant cast setting) - if(mod->op==SPELLMOD_CASTING_TIME && basevalue >= T(10*IN_MILLISECONDS) && mod->value <= -100) + if (mod->op==SPELLMOD_CASTING_TIME && basevalue >= T(10*IN_MILLISECONDS) && mod->value <= -100) continue; totalpct += mod->value; diff --git a/src/game/Objects/Totem.h b/src/game/Objects/Totem.h index 6ed037e2f..367f67992 100644 --- a/src/game/Objects/Totem.h +++ b/src/game/Objects/Totem.h @@ -54,7 +54,7 @@ class Totem : public Creature void UpdateArmor() override {} void UpdateMaxHealth() override {} void UpdateMaxPower(Powers /*power*/) override {} - void UpdateAttackPowerAndDamage(bool /*ranged*/ ) override {} + void UpdateAttackPowerAndDamage(bool /*ranged*/) override {} void UpdateDamagePhysical(WeaponAttackType /*attType*/) override {} bool IsImmuneToSpellEffect(SpellEntry const *spellInfo, SpellEffectIndex index, bool castOnSelf) const override; diff --git a/src/game/Objects/Unit.cpp b/src/game/Objects/Unit.cpp index e295a594b..50606d347 100644 --- a/src/game/Objects/Unit.cpp +++ b/src/game/Objects/Unit.cpp @@ -699,7 +699,7 @@ void Unit::DoKillUnit(Unit* pVictim) DealDamage(pVictim, pVictim->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); } -uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const *spellProto, bool durabilityLoss, Spell* spell) +uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const* spellProto, bool durabilityLoss, Spell* spell) { // remove affects from victim (including from 0 damage and DoTs) if (pVictim != this) @@ -827,7 +827,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa { if (GetPetGuid() == recipient) creaVictim->SetLootRecipient(this); - else if (Group *group = creaVictim->GetGroupLootRecipient()) + else if (Group* group = creaVictim->GetGroupLootRecipient()) { if (group == ToPlayer()->GetGroup()) creaVictim->SetLootRecipient(this); @@ -850,7 +850,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa if (duel_hasEnded) { MANGOS_ASSERT(pVictim->IsPlayer()); - Player *he = (Player*)pVictim; + Player* he = (Player*)pVictim; MANGOS_ASSERT(he->duel); @@ -989,7 +989,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa if (duel_hasEnded) { MANGOS_ASSERT(pVictim->IsPlayer()); - Player *he = (Player*)pVictim; + Player* he = (Player*)pVictim; MANGOS_ASSERT(he->duel); @@ -1006,14 +1006,14 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa return damage; } -void Unit::Kill(Unit* pVictim, SpellEntry const *spellProto, bool durabilityLoss) +void Unit::Kill(Unit* pVictim, SpellEntry const* spellProto, bool durabilityLoss) { // find player: owner of controlled `this` or `this` itself maybe // for loot will be sued only if pGroupTap == nullptr - Player *pPlayerTap = GetCharmerOrOwnerPlayerOrPlayerItself(); + Player* pPlayerTap = GetCharmerOrOwnerPlayerOrPlayerItself(); Creature* pCreatureVictim = pVictim->ToCreature(); Player* pPlayerVictim = pVictim->ToPlayer(); - Group *pGroupTap = nullptr; + Group* pGroupTap = nullptr; // in creature kill case group/player tap stored for pCreatureVictim if (pCreatureVictim) @@ -1188,7 +1188,7 @@ void Unit::Kill(Unit* pVictim, SpellEntry const *spellProto, bool durabilityLoss // handle player kill only if not suicide (spirit of redemption for example) if (this != pVictim) if (Player* pPlayer = ToPlayer()) - if (ZoneScript * pZoneScript = pPlayer->GetZoneScript()) + if (ZoneScript* pZoneScript = pPlayer->GetZoneScript()) pZoneScript->HandleKill(pPlayer, pVictim); DEBUG_FILTER_LOG(LOG_FILTER_DAMAGE, "DealDamageHealth1"); @@ -1249,7 +1249,7 @@ void Unit::Kill(Unit* pVictim, SpellEntry const *spellProto, bool durabilityLoss pCreatureVictim->UpdateCombatWithZoneState(false); pCreatureVictim->DeleteThreatList(); - if (CreatureInfo const *cinfo = pCreatureVictim->GetCreatureInfo()) + if (CreatureInfo const* cinfo = pCreatureVictim->GetCreatureInfo()) if (cinfo->loot_id || cinfo->gold_max > 0) pCreatureVictim->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } @@ -1298,13 +1298,13 @@ void Unit::Kill(Unit* pVictim, SpellEntry const *spellProto, bool durabilityLoss // battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill) if (pPlayerVictim && pPlayerVictim->InBattleGround()) { - if (BattleGround *bg = pPlayerVictim->GetBattleGround()) + if (BattleGround* bg = pPlayerVictim->GetBattleGround()) bg->HandleKillPlayer(pPlayerVictim, pPlayerTap); } else if (pCreatureVictim) { if (pPlayerTap) - if (BattleGround *bg = pPlayerTap->GetBattleGround()) + if (BattleGround* bg = pPlayerTap->GetBattleGround()) bg->HandleKillUnit(pCreatureVictim, pPlayerTap); } // Nostalrius: interrupt non melee spell casted @@ -1355,7 +1355,7 @@ void Unit::CastStop(uint32 except_spellid) // Obsolete func need remove, here only for comotability vs another patches uint32 Unit::SpellNonMeleeDamageLog(Unit* pVictim, uint32 spellID, uint32 damage) { - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spellID); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(spellID); SpellNonMeleeDamage damageInfo(this, pVictim, spellInfo->Id, SpellSchools(spellInfo->School)); CalculateSpellDamage(&damageInfo, damage, spellInfo); damageInfo.target->CalculateAbsorbResistBlock(this, &damageInfo, spellInfo); @@ -1366,7 +1366,7 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit* pVictim, uint32 spellID, uint32 damage } //TODO for melee need create structure as in -void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo *damageInfo, WeaponAttackType attackType) +void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType) { damageInfo->attacker = this; damageInfo->target = pVictim; @@ -1407,7 +1407,7 @@ void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo *da uint8 actualDamageCount = feral ? 1 : m_weaponDamageCount[damageInfo->attackType]; for (uint8 i = 0; i < actualDamageCount; i++) { - SubDamageInfo *subDamage = &damageInfo->subDamage[i]; + SubDamageInfo* subDamage = &damageInfo->subDamage[i]; // feral only allowed melee school subDamage->damageSchoolMask = IsPlayer() && !feral @@ -1428,7 +1428,7 @@ void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo *da subDamage->damage = damageInfo->target->MeleeDamageBonusTaken(this, subDamage->damage, damageInfo->attackType, nullptr, DIRECT_DAMAGE, 1, nullptr, i == 0); // Calculate armor reduction - if(subDamage->damageSchoolMask == SPELL_SCHOOL_MASK_NORMAL) + if (subDamage->damageSchoolMask == SPELL_SCHOOL_MASK_NORMAL) { damageInfo->cleanDamage += subDamage->damage; subDamage->damage = CalcArmorReducedDamage(damageInfo->target, subDamage->damage); @@ -1623,7 +1623,7 @@ void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo *da // Calculate absorb & resists for (uint8 i = 0; i < m_weaponDamageCount[damageInfo->attackType]; i++) { - SubDamageInfo *subDamage = &damageInfo->subDamage[i]; + SubDamageInfo* subDamage = &damageInfo->subDamage[i]; damageInfo->target->CalculateDamageAbsorbAndResist(this, subDamage->damageSchoolMask, DIRECT_DAMAGE, subDamage->damage, &subDamage->absorb, &subDamage->resist, nullptr); @@ -1661,7 +1661,7 @@ void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo *da damageInfo->totalDamage = 0; } -void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) +void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) { if (damageInfo == nullptr) return; Unit* pVictim = damageInfo->target; @@ -1749,7 +1749,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) SpellAuraHolderMap const& vAuras = pVictim->GetSpellAuraHolderMap(); for (const auto& itr : vAuras) { - SpellEntry const *spellInfo = itr.second->GetSpellProto(); + SpellEntry const* spellInfo = itr.second->GetSpellProto(); if (spellInfo->AttributesEx3 & 0x40000 && spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && (itr.second->GetCasterGuid() == GetObjectGuid())) itr.second->RefreshHolder(); } @@ -1771,7 +1771,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) { alreadyDone.insert(*i); uint32 damage = (*i)->GetModifier()->m_amount; - SpellEntry const *i_spellProto = (*i)->GetSpellProto(); + SpellEntry const* i_spellProto = (*i)->GetSpellProto(); // Apply damage percentage modifiers (#1601) float DoneTotalMod = 1.0f; @@ -1893,7 +1893,7 @@ static ResistanceValues resistValues[] = {25, 55, 16, 3, 1, 75} // 300 }; -void Unit::CalculateDamageAbsorbAndResist(WorldObject* pCaster, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, int32 *resist, SpellEntry const* spellProto, Spell* spell) +void Unit::CalculateDamageAbsorbAndResist(WorldObject* pCaster, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32* absorb, int32* resist, SpellEntry const* spellProto, Spell* spell) { if (!pCaster || !IsAlive() || !damage) return; @@ -2002,7 +2002,7 @@ void Unit::CalculateDamageAbsorbAndResist(WorldObject* pCaster, SpellSchoolMask if (float manaMultiplier = (*i)->GetSpellProto()->EffectMultipleValue[(*i)->GetEffIndex()]) { - if (Player *modOwner = GetSpellModOwner()) + if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod((*i)->GetId(), SPELLMOD_MULTIPLE_VALUE, manaMultiplier, spell); int32 maxAbsorb = int32(GetPower(POWER_MANA) / manaMultiplier); @@ -2092,7 +2092,7 @@ void Unit::CalculateDamageAbsorbAndResist(WorldObject* pCaster, SpellSchoolMask *absorb = damage - RemainingDamage - *resist; } -void Unit::CalculateAbsorbResistBlock(WorldObject* pCaster, SpellNonMeleeDamage *damageInfo, SpellEntry const* spellProto, WeaponAttackType attType, Spell* spell) +void Unit::CalculateAbsorbResistBlock(WorldObject* pCaster, SpellNonMeleeDamage* damageInfo, SpellEntry const* spellProto, WeaponAttackType attType, Spell* spell) { bool blocked = false; // Get blocked status @@ -2366,7 +2366,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* pVictim, WeaponAttackT !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) && !SpellCasted /*Only autoattack can be crashing blow*/) { - if ( ((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_ALWAYS_CRUSH ) + if (((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_ALWAYS_CRUSH) { return MELEE_HIT_CRUSHING; } @@ -2830,7 +2830,7 @@ void Unit::_UpdateSpells(uint32 time) // remove expired auras for (SpellAuraHolderMap::iterator iter = m_spellAuraHolders.begin(); iter != m_spellAuraHolders.end();) { - SpellAuraHolder *holder = iter->second; + SpellAuraHolder* holder = iter->second; if (!(holder->IsPermanent() || holder->IsPassive()) && holder->GetAuraDuration() == 0) { @@ -2847,7 +2847,7 @@ void Unit::_UpdateSpells(uint32 time) for (ite1 = m_gameObj.begin(); ite1 != m_gameObj.end(); ite1 = dnext1) { dnext1 = ite1; - //(*i)->Update( difftime ); + //(*i)->Update(difftime); if (!(*ite1)->isSpawned()) { (*ite1)->SetOwnerGuid(ObjectGuid()); @@ -3087,7 +3087,7 @@ float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_valu return multiplier; } -bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder) +bool Unit::AddSpellAuraHolder(SpellAuraHolder* holder) { SpellEntry const* aurSpellInfo = holder->GetSpellProto(); @@ -3117,7 +3117,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder) // take out same spell for (SpellAuraHolderMap::iterator iter = spair.first; iter != spair.second; ++iter) { - SpellAuraHolder *foundHolder = iter->second; + SpellAuraHolder* foundHolder = iter->second; if ((foundHolder->GetCasterGuid() == holder->GetCasterGuid() && foundHolder->GetCastItemGuid() == holder->GetCastItemGuid()) || aurSpellInfo->Custom & SPELL_CUSTOM_ALLOW_STACK_BETWEEN_CASTER) { @@ -3250,7 +3250,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder) m_spellAuraHolders.insert(SpellAuraHolderMap::value_type(holder->GetId(), holder)); for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) - if (Aura *aur = holder->GetAuraByEffectIndex(SpellEffectIndex(i))) + if (Aura* aur = holder->GetAuraByEffectIndex(SpellEffectIndex(i))) AddAuraToModList(aur); holder->ApplyAuraModifiers(true, true); @@ -3316,13 +3316,13 @@ bool Unit::RemoveAuraDueToDebuffLimit(SpellAuraHolder* currentAura) return currentAura == removeAuraHolder; } -void Unit::AddAuraToModList(Aura *aura) +void Unit::AddAuraToModList(Aura* aura) { if (aura->GetModifier()->m_auraname < TOTAL_AURAS) m_modAuras[aura->GetModifier()->m_auraname].push_back(aura); } -bool Unit::RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder *holder) +bool Unit::RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder* holder) { if (!holder) return false; @@ -3573,7 +3573,7 @@ void Unit::RemoveAura(uint32 spellId, SpellEffectIndex effindex, Aura* except) SpellAuraHolderBounds spair = GetSpellAuraHolderBounds(spellId); for (SpellAuraHolderMap::iterator iter = spair.first; iter != spair.second;) { - Aura *aur = iter->second->m_auras[effindex]; + Aura* aur = iter->second->m_auras[effindex]; if (aur && aur != except) { RemoveSingleAuraFromSpellAuraHolder(iter->second, effindex); @@ -3606,7 +3606,7 @@ void Unit::RemoveSingleAuraFromSpellAuraHolder(uint32 spellId, SpellEffectIndex SpellAuraHolderBounds spair = GetSpellAuraHolderBounds(spellId); for (SpellAuraHolderMap::iterator iter = spair.first; iter != spair.second;) { - Aura *aur = iter->second->m_auras[effindex]; + Aura* aur = iter->second->m_auras[effindex]; if (aur && aur->GetCasterGuid() == casterGuid) { RemoveSingleAuraFromSpellAuraHolder(iter->second, effindex, mode); @@ -3784,7 +3784,7 @@ void Unit::RemoveNotOwnSingleTargetAuras() } -void Unit::DeleteAuraHolder(SpellAuraHolder *holder) +void Unit::DeleteAuraHolder(SpellAuraHolder* holder) { if (holder->IsInUse()) { @@ -3795,7 +3795,7 @@ void Unit::DeleteAuraHolder(SpellAuraHolder *holder) delete holder; } -void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode) +void Unit::RemoveSpellAuraHolder(SpellAuraHolder* holder, AuraRemoveMode mode) { // Statue unsummoned at holder remove Totem* statue = nullptr; @@ -3827,7 +3827,7 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode) for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) { - if (Aura *aura = holder->m_auras[i]) + if (Aura* aura = holder->m_auras[i]) RemoveAura(aura, mode); } @@ -3847,7 +3847,7 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode) if (isChanneled && caster) { - Spell *channeled = caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL); + Spell* channeled = caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL); if (channeled && channeled->m_spellInfo->Id == auraSpellId) { // If single target, interrupt cast. If not, notify the spell caster so we @@ -3860,9 +3860,9 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode) } } -void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEffectIndex index, AuraRemoveMode mode) +void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder* holder, SpellEffectIndex index, AuraRemoveMode mode) { - Aura *aura = holder->GetAuraByEffectIndex(index); + Aura* aura = holder->GetAuraByEffectIndex(index); if (!aura) return; @@ -3872,7 +3872,7 @@ void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEff RemoveAura(aura, mode); } -void Unit::RemoveAura(Aura *Aur, AuraRemoveMode mode) +void Unit::RemoveAura(Aura* Aur, AuraRemoveMode mode) { // remove from list before mods removing (prevent cyclic calls, mods added before including to aura list - use reverse order) if (Aur->GetModifier()->m_auraname < TOTAL_AURAS) @@ -4150,10 +4150,10 @@ void Unit::RemoveAllGameObjects() } } -void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo, AuraType auraTypeOverride) const +void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo, AuraType auraTypeOverride) const { - Aura *aura = pInfo->aura; - Modifier *mod = aura->GetModifier(); + Aura* aura = pInfo->aura; + Modifier* mod = aura->GetModifier(); AuraType auraType = auraTypeOverride ? auraTypeOverride : mod->m_auraname; WorldPacket data(SMSG_PERIODICAURALOG, 30); @@ -4213,7 +4213,7 @@ public: return spellId == b.spellId && unit == b.unit; } uint32 spellId; - Unit* unit; + Unit* unit; }; typedef std::list RemoveSpellList; @@ -4229,14 +4229,14 @@ void Unit::HandleTriggers(Unit* pVictim, uint32 procExtra, uint32 amount, SpellE for (const auto& itr : procTriggered) { // Some auras can be deleted in function called in this loop (except first, ofc) - SpellAuraHolder *triggeredByHolder = itr.triggeredByHolder; + SpellAuraHolder* triggeredByHolder = itr.triggeredByHolder; if (triggeredByHolder->IsDeleted()) { triggeredByHolder->SetInUse(false); continue; } - SpellProcEventEntry const *spellProcEvent = itr.spellProcEvent; + SpellProcEventEntry const* spellProcEvent = itr.spellProcEvent; bool useCharges = triggeredByHolder->GetAuraCharges() > 0; bool procSuccess = true; bool anyAuraProc = false; @@ -4254,11 +4254,11 @@ void Unit::HandleTriggers(Unit* pVictim, uint32 procExtra, uint32 amount, SpellE for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) { - Aura *triggeredByAura = triggeredByHolder->GetAuraByEffectIndex(SpellEffectIndex(i)); + Aura* triggeredByAura = triggeredByHolder->GetAuraByEffectIndex(SpellEffectIndex(i)); if (!triggeredByAura) continue; - Modifier *auraModifier = triggeredByAura->GetModifier(); + Modifier* auraModifier = triggeredByAura->GetModifier(); if (procSpell) { @@ -4317,7 +4317,7 @@ void Unit::HandleTriggers(Unit* pVictim, uint32 procExtra, uint32 amount, SpellE } } -void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo) const +void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo) const { DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Sending SMSG_ATTACKERSTATEUPDATE"); @@ -4338,7 +4338,7 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo) const // Sub damage description for (uint8 i = 0; i < m_weaponDamageCount[damageInfo->attackType]; i++) { - SubDamageInfo *subDamage = &damageInfo->subDamage[i]; + SubDamageInfo* subDamage = &damageInfo->subDamage[i]; data << uint32(GetFirstSchoolInMask(subDamage->damageSchoolMask)); data << float(subDamage->damage)/ float(damageInfo->totalDamage); // Float coefficient of sub damage @@ -4693,7 +4693,7 @@ void Unit::ModifyAuraState(AuraState flag, bool apply) for (const auto& itr : sp_list) { if (itr.second.state == PLAYERSPELL_REMOVED) continue; - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(itr.first); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(itr.first); if (!spellInfo || !spellInfo->IsPassiveSpell()) continue; if (AuraState(spellInfo->CasterAuraState) == flag) CastSpell(this, itr.first, true, nullptr); @@ -4869,7 +4869,7 @@ void Unit::RestoreFaction() pPlayer->SetFactionForRace(GetRace()); else { - if (CreatureInfo const *cinfo = ((Creature*)this)->GetCreatureInfo()) // normal creature + if (CreatureInfo const* cinfo = ((Creature*)this)->GetCreatureInfo()) // normal creature SetFactionTemplateId(cinfo->faction); } } @@ -4972,7 +4972,7 @@ Totem* Unit::GetTotem(TotemSlot slot) const if (slot >= MAX_TOTEM_SLOT || !IsInWorld() || !m_TotemSlot[slot]) return nullptr; - Creature *totem = GetMap()->GetCreature(m_TotemSlot[slot]); + Creature* totem = GetMap()->GetCreature(m_TotemSlot[slot]); return totem && totem->IsTotem() ? (Totem*)totem : nullptr; } @@ -5011,7 +5011,7 @@ void Unit::UnsummonAllTotems() bool Unit::UnsummonOldPetBeforeNewSummon(uint32 newPetEntry) { - Pet *OldSummon = GetPet(); + Pet* OldSummon = GetPet(); // if pet requested type already exist if (OldSummon) @@ -5047,7 +5047,7 @@ void Unit::SendEnvironmentalDamageLog(uint8 type, uint32 damage, uint32 absorb, * Calculates target part of spell damage bonuses, * will be called on each tick for periodic damage over time auras */ -uint32 Unit::SpellDamageBonusTaken(WorldObject* pCaster, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack, Spell* spell) const +uint32 Unit::SpellDamageBonusTaken(WorldObject* pCaster, SpellEntry const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack, Spell* spell) const { if (!spellProto || !pCaster || damagetype == DIRECT_DAMAGE) return pdamage; @@ -5292,7 +5292,7 @@ bool Unit::IsImmuneToDamage(SpellSchoolMask shoolMask, SpellEntry const* spellIn return false; } -bool Unit::IsImmuneToSpell(SpellEntry const *spellInfo, bool /*castOnSelf*/) const +bool Unit::IsImmuneToSpell(SpellEntry const* spellInfo, bool /*castOnSelf*/) const { if (!spellInfo) return false; @@ -5305,9 +5305,9 @@ bool Unit::IsImmuneToSpell(SpellEntry const *spellInfo, bool /*castOnSelf*/) con if (itr.type == spellInfo->Dispel) return true; - if ( !(spellInfo->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) // ignore invulnerability - && !(spellInfo->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE) // unaffected by school immunity - && !(spellInfo->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)) // can remove immune (by dispell or immune it) + if (!(spellInfo->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) // ignore invulnerability + && !(spellInfo->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE) // unaffected by school immunity + && !(spellInfo->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)) // can remove immune (by dispell or immune it) { SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; for (const auto& itr : schoolList) @@ -5459,7 +5459,7 @@ void Unit::ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply) } } -void Unit::ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType type, bool apply) +void Unit::ApplySpellDispelImmunity(const SpellEntry* spellProto, DispelType type, bool apply) { ApplySpellImmune(spellProto->Id, IMMUNITY_DISPEL, type, apply); @@ -6167,7 +6167,7 @@ bool Unit::CanDetectInvisibilityOf(Unit const* u) const return false; } -bool Unit::CanDetectStealthOf(Unit const* target, float distance, bool *alert) const +bool Unit::CanDetectStealthOf(Unit const* target, float distance, bool* alert) const { if (HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_PENDING_STUNNED)) return false; @@ -6687,7 +6687,7 @@ void Unit::SetSpeedRate(UnitMoveType mtype, float rate) MovementPacketSender::AddSpeedChangeToController(this, mtype, rate); else if (IsMovedByPlayer() && !IsInWorld()) // (1) SetSpeedRateReal(mtype, rate); - else // <=> if(!IsMovedByPlayer()) + else // <=> if (!IsMovedByPlayer()) { SetSpeedRateReal(mtype, rate); MovementPacketSender::SendSpeedChangeToAll(this, mtype, rate); @@ -6918,7 +6918,7 @@ float Unit::ApplyTotalThreatModifier(float threat, SpellSchoolMask schoolMask) //====================================================================== -void Unit::AddThreat(Unit* pVictim, float threat /*= 0.0f*/, bool crit /*= false*/, SpellSchoolMask schoolMask /*= SPELL_SCHOOL_MASK_NONE*/, SpellEntry const *threatSpell /*= nullptr*/) +void Unit::AddThreat(Unit* pVictim, float threat /*= 0.0f*/, bool crit /*= false*/, SpellSchoolMask schoolMask /*= SPELL_SCHOOL_MASK_NONE*/, SpellEntry const* threatSpell /*= nullptr*/) { // Only mobs can manage threat lists if (CanHaveThreatList() && IsInMap(pVictim)) @@ -7852,7 +7852,7 @@ void CharmInfo::InitCharmCreateSpells() ActiveStates newstate; bool onlyselfcast = true; - SpellEntry const *pSpellEntry = sSpellMgr.GetSpellEntry(spellId); + SpellEntry const* pSpellEntry = sSpellMgr.GetSpellEntry(spellId); if (!pSpellEntry) onlyselfcast = false; @@ -8063,7 +8063,7 @@ bool CharmInfo::IsReturning() return _isReturning; } -uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition) +uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition) { uint32 procEx = PROC_EX_NONE; switch (missCondition) @@ -8862,7 +8862,7 @@ bool Unit::IsSecondaryThreatTarget() const { if (Totem const* pTotem = pCreature->ToTotem()) { - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(pTotem->GetSpell()); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(pTotem->GetSpell()); if (!spellInfo) return true; @@ -8964,7 +8964,7 @@ void Unit::RemoveAurasAtMechanicImmunity(uint32 mechMask, uint32 exceptSpellId, Unit::SpellAuraHolderMap& auras = GetSpellAuraHolderMap(); for (Unit::SpellAuraHolderMap::iterator iter = auras.begin(); iter != auras.end();) { - SpellEntry const *spell = iter->second->GetSpellProto(); + SpellEntry const* spell = iter->second->GetSpellProto(); if (spell->Id == exceptSpellId) ++iter; else if (non_positive && iter->second->IsPositive()) @@ -8996,7 +8996,7 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, uint32 t Creature* c = (Creature*)this; // Creature relocation acts like instant movement generator, so current generator expects interrupt/reset calls to react properly if (!c->GetMotionMaster()->empty()) - if (MovementGenerator *movgen = c->GetMotionMaster()->top()) + if (MovementGenerator* movgen = c->GetMotionMaster()->top()) movgen->Interrupt(*c); GetMap()->CreatureRelocation((Creature*)this, x, y, z, orientation); @@ -9005,7 +9005,7 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, uint32 t // finished relocation, movegen can different from top before creature relocation, // but apply Reset expected to be safe in any case if (!c->GetMotionMaster()->empty()) - if (MovementGenerator *movgen = c->GetMotionMaster()->top()) + if (MovementGenerator* movgen = c->GetMotionMaster()->top()) movgen->Reset(*c); } } @@ -9043,7 +9043,7 @@ void Unit::TeleportPositionRelocation(float x, float y, float z, float orientati else if (crea) { if (!crea->GetMotionMaster()->empty()) - if (MovementGenerator *movgen = crea->GetMotionMaster()->top()) + if (MovementGenerator* movgen = crea->GetMotionMaster()->top()) movgen->Interrupt(*crea); GetMap()->CreatureRelocation(crea, x, y, z, orientation); } @@ -9062,7 +9062,7 @@ void Unit::TeleportPositionRelocation(float x, float y, float z, float orientati else if (crea) { if (!crea->GetMotionMaster()->empty()) - if (MovementGenerator *movgen = crea->GetMotionMaster()->top()) + if (MovementGenerator* movgen = crea->GetMotionMaster()->top()) movgen->Reset(*crea); } } @@ -9267,7 +9267,7 @@ public: MaNGOS::PlayerRelocationNotifier notify((Player&)m_owner); Cell::VisitAllObjects(&m_owner, notify, radius); } - else //if(m_owner.IsCreature()) + else //if (m_owner.IsCreature()) { MaNGOS::CreatureRelocationNotifier notify((Creature&)m_owner); Cell::VisitAllObjects(&m_owner, notify, radius); @@ -9341,7 +9341,7 @@ void Unit::InterruptSpellsCastedOnMe(bool killDelayed, bool interruptPositiveSpe if (!interruptPositiveSpells && IsFriendlyTo(iter)) continue; for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++) - if (Spell *spell = iter->GetCurrentSpell(CurrentSpellTypes(i))) + if (Spell* spell = iter->GetCurrentSpell(CurrentSpellTypes(i))) if (spell->m_targets.getUnitTargetGuid() == GetObjectGuid()) if (killDelayed || (spell->getState() == SPELL_STATE_PREPARING && spell->GetCastedTime()) || i == CURRENT_CHANNELED_SPELL) iter->InterruptSpell(CurrentSpellTypes(i), true); @@ -9590,7 +9590,7 @@ Unit* Unit::SummonCreatureAndAttack(uint32 creatureEntry, Unit* pVictim) if (!(pVictim = GetVictim())) return nullptr; - if (Creature *pCreature = SummonCreature(creatureEntry, summonX, summonY, summonZ, summonAng, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 25000)) + if (Creature* pCreature = SummonCreature(creatureEntry, summonX, summonY, summonZ, summonAng, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 25000)) { if (pCreature->AI()) pCreature->AI()->AttackStart(pVictim); @@ -9693,7 +9693,7 @@ SpellAuraHolder* Unit::AddAura(uint32 spellId, uint32 addAuraFlags, Unit* pCaste if (IsDeleted() || (pCaster && pCaster->IsDeleted())) return nullptr; - SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spellId); + SpellEntry const* spellInfo = sSpellMgr.GetSpellEntry(spellId); if (!spellInfo) return nullptr; @@ -9707,7 +9707,7 @@ SpellAuraHolder* Unit::AddAura(uint32 spellId, uint32 addAuraFlags, Unit* pCaste if (!pCaster) pCaster = this; - SpellAuraHolder *holder = CreateSpellAuraHolder(spellInfo, this, pCaster, pCaster); + SpellAuraHolder* holder = CreateSpellAuraHolder(spellInfo, this, pCaster, pCaster); if (!holder) return nullptr; @@ -9726,7 +9726,7 @@ SpellAuraHolder* Unit::AddAura(uint32 spellId, uint32 addAuraFlags, Unit* pCaste eff == SPELL_EFFECT_APPLY_AURA || eff == SPELL_EFFECT_PERSISTENT_AREA_AURA) { - Aura *aur = CreateAura(spellInfo, SpellEffectIndex(i), nullptr, holder, this, pCaster); + Aura* aur = CreateAura(spellInfo, SpellEffectIndex(i), nullptr, holder, this, pCaster); if (addAuraFlags & ADD_AURA_POSITIVE) aur->SetPositive(true); else if (addAuraFlags & ADD_AURA_NEGATIVE) @@ -9742,7 +9742,7 @@ SpellAuraHolder* Unit::AddAura(uint32 spellId, uint32 addAuraFlags, Unit* pCaste SpellAuraHolder* Unit::RefreshAura(uint32 spellId, int32 duration) { - if (SpellAuraHolder *holder = GetSpellAuraHolder(spellId)) + if (SpellAuraHolder* holder = GetSpellAuraHolder(spellId)) { holder->SetAuraDuration(duration); holder->UpdateAuraDuration(); @@ -10112,7 +10112,7 @@ void Unit::RestoreMovement() // Need restore previous movement since we have no proper states system if (IsAlive() && !HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING)) { - if (Unit* victim = GetVictim()) + if (Unit* victim = GetVictim()) GetMotionMaster()->MoveChase(victim); else GetMotionMaster()->Initialize(); @@ -10177,7 +10177,7 @@ void Unit::SetNativeScale(float scale) m_nativeScale = scale; } -void Unit::CooldownEvent(SpellEntry const *spellInfo, uint32 itemId, Spell* spell) +void Unit::CooldownEvent(SpellEntry const* spellInfo, uint32 itemId, Spell* spell) { // start cooldowns at server side, if any AddSpellAndCategoryCooldowns(spellInfo, itemId, spell); @@ -10323,7 +10323,7 @@ void Unit::WritePetSpellsCooldown(WorldPacket& data) const void Unit::InitPlayerDisplayIds() { - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(GetRace(), GetClass()); + PlayerInfo const* info = sObjectMgr.GetPlayerInfo(GetRace(), GetClass()); if (!info) return; diff --git a/src/game/Objects/Unit.h b/src/game/Objects/Unit.h index 046a0a0d3..36165f25d 100644 --- a/src/game/Objects/Unit.h +++ b/src/game/Objects/Unit.h @@ -136,8 +136,8 @@ struct SubDamageInfo // Need create structure like in SMSG_ATTACKERSTATEUPDATE opcode struct CalcDamageInfo { - Unit *attacker = nullptr; // Attacker - Unit *target = nullptr; // Target for damage + Unit* attacker = nullptr; // Attacker + Unit* target = nullptr; // Target for damage uint32 totalDamage = 0; uint32 totalAbsorb = 0; int32 totalResist = 0; @@ -157,17 +157,17 @@ struct CalcDamageInfo struct SpellPeriodicAuraLogInfo { - SpellPeriodicAuraLogInfo(Aura *_aura, uint32 _damage, uint32 _absorb, int32 _resist, float _multiplier) + SpellPeriodicAuraLogInfo(Aura* _aura, uint32 _damage, uint32 _absorb, int32 _resist, float _multiplier) : aura(_aura), damage(_damage), absorb(_absorb), resist(_resist), multiplier(_multiplier) {} - Aura *aura; + Aura* aura; uint32 damage; uint32 absorb; int32 resist; float multiplier; }; -uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition); +uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition); enum SpellAuraProcResult { @@ -176,7 +176,7 @@ enum SpellAuraProcResult SPELL_AURA_PROC_CANT_TRIGGER = 2 // aura can't trigger - skip charges taking, move to next aura if exists }; -typedef SpellAuraProcResult(Unit::*pAuraProcHandler)(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); +typedef SpellAuraProcResult(Unit::*pAuraProcHandler)(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); extern pAuraProcHandler AuraProcHandler[TOTAL_AURAS]; #define UNIT_SPELL_UPDATE_TIME_BUFFER 60 @@ -346,10 +346,10 @@ struct ProhibitSpellInfo struct ProcTriggeredData { - ProcTriggeredData(SpellProcEventEntry const * _spellProcEvent, SpellAuraHolder* _triggeredByHolder, Unit* _target, uint32 _procFlag) + ProcTriggeredData(SpellProcEventEntry const* _spellProcEvent, SpellAuraHolder* _triggeredByHolder, Unit* _target, uint32 _procFlag) : spellProcEvent(_spellProcEvent), triggeredByHolder(_triggeredByHolder), target(_target), procFlag(_procFlag) {} - SpellProcEventEntry const *spellProcEvent; + SpellProcEventEntry const* spellProcEvent; SpellAuraHolder* triggeredByHolder; Unit* target; uint32 procFlag; @@ -366,13 +366,13 @@ class MANGOS_DLL_SPEC Unit : public WorldObject typedef std::multimap< uint32, SpellAuraHolder*> SpellAuraHolderMap; typedef std::pair SpellAuraHolderBounds; typedef std::pair SpellAuraHolderConstBounds; - typedef std::list SpellAuraHolderList; - typedef std::list AuraList; + typedef std::list SpellAuraHolderList; + typedef std::list AuraList; typedef std::list Diminishing; typedef std::set ComboPointHolderSet; typedef std::map SingleCastSpellTargetMap; - ~Unit ( ) override; + ~Unit () override; void AddToWorld() override; void RemoveFromWorld() override; @@ -437,10 +437,10 @@ class MANGOS_DLL_SPEC Unit : public WorldObject Powers GetPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, 3)); } void SetPowerType(Powers power); void SetInitCreaturePowerType(); - uint32 GetPower( Powers power) const { return GetUInt32Value(UNIT_FIELD_POWER1 +power); } + uint32 GetPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_POWER1 +power); } uint32 GetMaxPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_MAXPOWER1+power); } float GetPowerPercent(Powers power) const { return GetMaxPower(power) ? ((GetPower(power)*100.0f) / GetMaxPower(power)) : 100.0f; } - void SetPower( Powers power, uint32 val); + void SetPower(Powers power, uint32 val); void SetMaxPower(Powers power, uint32 val); void SetPowerPercent(Powers power, float percent); int32 ModifyPower(Powers power, int32 val); @@ -578,29 +578,29 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void InitPlayerDisplayIds(); void DeMorph(); - bool IsVendor() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR ); } - bool IsTrainer() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER ); } - bool IsQuestGiver() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER ); } - bool IsGossip() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP ); } - bool IsTaxi() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_FLIGHTMASTER ); } - bool IsGuildMaster() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PETITIONER ); } - bool IsBattleMaster() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BATTLEMASTER ); } - bool IsBanker() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER ); } - bool IsInnkeeper() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_INNKEEPER ); } - bool IsSpiritHealer() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER ); } - bool IsSpiritGuide() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITGUIDE ); } - bool IsTabardDesigner()const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TABARDDESIGNER ); } - bool IsAuctioner() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_AUCTIONEER ); } - bool IsArmorer() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_REPAIR ); } + bool IsVendor() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); } + bool IsTrainer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER); } + bool IsQuestGiver() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); } + bool IsGossip() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } + bool IsTaxi() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_FLIGHTMASTER); } + bool IsGuildMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PETITIONER); } + bool IsBattleMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BATTLEMASTER); } + bool IsBanker() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER); } + bool IsInnkeeper() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_INNKEEPER); } + bool IsSpiritHealer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER); } + bool IsSpiritGuide() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITGUIDE); } + bool IsTabardDesigner()const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TABARDDESIGNER); } + bool IsAuctioner() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_AUCTIONEER); } + bool IsArmorer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_REPAIR); } bool IsServiceProvider() const { - return HasFlag( UNIT_NPC_FLAGS, + return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR | UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_FLIGHTMASTER | UNIT_NPC_FLAG_PETITIONER | UNIT_NPC_FLAG_BATTLEMASTER | UNIT_NPC_FLAG_BANKER | UNIT_NPC_FLAG_INNKEEPER | UNIT_NPC_FLAG_SPIRITHEALER | - UNIT_NPC_FLAG_SPIRITGUIDE | UNIT_NPC_FLAG_TABARDDESIGNER | UNIT_NPC_FLAG_AUCTIONEER ); + UNIT_NPC_FLAG_SPIRITGUIDE | UNIT_NPC_FLAG_TABARDDESIGNER | UNIT_NPC_FLAG_AUCTIONEER); } - bool IsSpiritService() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE ); } + bool IsSpiritService() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); } bool IsTaxiFlying() const { return HasUnitState(UNIT_STAT_TAXI_FLIGHT); } bool IsCaster() const; @@ -723,14 +723,14 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void SendSpellGo(Unit* target, uint32 spellId) const; void SendPlaySpellVisual(uint32 id) const; - void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo, AuraType auraTypeOverride = SPELL_AURA_NONE) const; + void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo, AuraType auraTypeOverride = SPELL_AURA_NONE) const; void SendEnvironmentalDamageLog(uint8 type, uint32 damage, uint32 absorb, int32 resist) const; uint32 SpellNonMeleeDamageLog(Unit* pVictim, uint32 spellID, uint32 damage); SpellAuraHolder* AddAura(uint32 spellId, uint32 addAuraFlags = 0, Unit* pCaster = nullptr); SpellAuraHolder* RefreshAura(uint32 spellId, int32 duration); - bool AddSpellAuraHolder(SpellAuraHolder *holder); - void AddAuraToModList(Aura *aura); + bool AddSpellAuraHolder(SpellAuraHolder* holder); + void AddAuraToModList(Aura* aura); // pet auras typedef std::set PetAuraSet; @@ -749,11 +749,11 @@ class MANGOS_DLL_SPEC Unit : public WorldObject // removing specific aura stack void RemoveAura(Aura* aura, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); void RemoveAura(uint32 spellId, SpellEffectIndex effindex, Aura* except = nullptr); - void RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); - void RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEffectIndex index, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); + void RemoveSpellAuraHolder(SpellAuraHolder* holder, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); + void RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder* holder, SpellEffectIndex index, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); void RemoveSingleAuraFromSpellAuraHolder(uint32 id, SpellEffectIndex index, ObjectGuid casterGuid, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); void RemoveSingleAuraDueToItemSet(uint32 spellId, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); - void DeleteAuraHolder(SpellAuraHolder *holder); + void DeleteAuraHolder(SpellAuraHolder* holder); // removing specific aura stacks by diff reasons and selections void RemoveAurasDueToSpell(uint32 spellId, SpellAuraHolder* except = nullptr, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); @@ -767,7 +767,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void RemoveSpellsCausingAura(AuraType auraType); void RemoveNonPassiveSpellsCausingAura(AuraType auraType); void RemoveSpellsCausingAura(AuraType auraType, SpellAuraHolder* except); - bool RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder *holder); + bool RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder* holder); void RemoveAurasWithInterruptFlags(uint32 flags, uint32 except = 0); void RemoveAurasWithAttribute(uint32 flags); void RemoveAurasWithDispelType(DispelType type, ObjectGuid casterGuid = ObjectGuid()); @@ -867,27 +867,27 @@ class MANGOS_DLL_SPEC Unit : public WorldObject uint32 SpellDamageBonusTaken(WorldObject* pCaster, SpellEntry const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1, Spell* spell = nullptr) const; int32 SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask) const; uint32 SpellHealingBonusTaken(WorldObject* pCaster, SpellEntry const* spellProto, int32 healamount, DamageEffectType damagetype, uint32 stack = 1, Spell* spell = nullptr) const; - void CalculateDamageAbsorbAndResist(WorldObject* pCaster, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, int32 *resist, SpellEntry const* spellProto = nullptr, Spell* spell = nullptr); - void CalculateAbsorbResistBlock(WorldObject* pCaster, SpellNonMeleeDamage *damageInfo, SpellEntry const* spellProto, WeaponAttackType attType = BASE_ATTACK, Spell* spell = nullptr); + void CalculateDamageAbsorbAndResist(WorldObject* pCaster, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32* absorb, int32* resist, SpellEntry const* spellProto = nullptr, Spell* spell = nullptr); + void CalculateAbsorbResistBlock(WorldObject* pCaster, SpellNonMeleeDamage* damageInfo, SpellEntry const* spellProto, WeaponAttackType attType = BASE_ATTACK, Spell* spell = nullptr); float RollMagicResistanceMultiplierOutcomeAgainst(float resistanceChance, SpellSchoolMask schoolMask, DamageEffectType dmgType, SpellEntry const* spellProto) const; - bool IsSpellBlocked(WorldObject* pCaster, Unit* pVictim, SpellEntry const *spellProto, WeaponAttackType attackType = BASE_ATTACK) const; + bool IsSpellBlocked(WorldObject* pCaster, Unit* pVictim, SpellEntry const* spellProto, WeaponAttackType attackType = BASE_ATTACK) const; bool IsSpellCrit(Unit const* pVictim, SpellEntry const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK, Spell* spell = nullptr) const final; bool IsEffectResist(SpellEntry const* spell, int eff) const; // SPELL_AURA_MOD_MECHANIC_RESISTANCE bool IsTriggeredAtSpellProcEvent(Unit* pVictim, SpellAuraHolder* holder, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, SpellProcEventEntry const*& spellProcEvent) const; // Aura proc handlers - SpellAuraProcResult HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleHasteAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleProcTriggerDamageAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleOverrideClassScriptAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleModCastingSpeedNotStackAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleReflectSpellsSchoolAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleModPowerCostSchoolAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleMechanicImmuneResistanceAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleAddTargetTriggerAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleModResistanceAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleModDamageAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleHasteAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleProcTriggerDamageAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleOverrideClassScriptAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleModCastingSpeedNotStackAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleReflectSpellsSchoolAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleModPowerCostSchoolAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleMechanicImmuneResistanceAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleAddTargetTriggerAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleModResistanceAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleModDamageAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); SpellAuraProcResult HandleNULLProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* /*triggeredByAura*/, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) { // no proc handler for this aura type @@ -903,7 +903,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject bool IsUnderLastManaUseEffect() const { return m_lastManaUseTimer; } void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply); - void ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType type, bool apply); + void ApplySpellDispelImmunity(const SpellEntry* spellProto, DispelType type, bool apply); virtual bool IsImmuneToSpell(SpellEntry const* spellInfo, bool castOnSelf) const; virtual bool IsImmuneToDamage(SpellSchoolMask meleeSchoolMask, SpellEntry const* spellInfo = nullptr) const; virtual bool IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index, bool castOnSelf) const; @@ -931,7 +931,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject time_t t = time(nullptr); return itr != m_spellCooldowns.end() && itr->second.end > t ? itr->second.end - t : 0; } - void CooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0, Spell* spell = nullptr); + void CooldownEvent(SpellEntry const* spellInfo, uint32 itemId = 0, Spell* spell = nullptr); void AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell = nullptr, bool infinityCooldown = false); void RemoveSpellCooldown(uint32 spell_id, bool update = false); void RemoveAllSpellCooldown(); @@ -1039,24 +1039,24 @@ class MANGOS_DLL_SPEC Unit : public WorldObject } void AttackerStateUpdate(Unit* pVictim, WeaponAttackType attType = BASE_ATTACK, bool checkLoS = true, bool extra = false); - void SendAttackStateUpdate(CalcDamageInfo *damageInfo) const; + void SendAttackStateUpdate(CalcDamageInfo* damageInfo) const; void SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, int32 Resist, VictimState TargetState, uint32 BlockedAmount) const; void SendMeleeAttackStop(Unit* victim) const; void SendMeleeAttackStart(Unit* pVictim) const; void ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const* procSpell, uint32 damage, ProcTriggeredList& triggeredList, Spell* spell = nullptr); - void HandleTriggers(Unit* pVictim, uint32 procExtra, uint32 amount, SpellEntry const *procSpell, ProcTriggeredList const& procTriggered); + void HandleTriggers(Unit* pVictim, uint32 procExtra, uint32 amount, SpellEntry const* procSpell, ProcTriggeredList const& procTriggered); void ClearAllReactives(); void StartReactiveTimer(ReactiveType reactive, ObjectGuid target) { m_reactiveTimer[reactive] = REACTIVE_TIMER_START; m_reactiveTarget[reactive] = target; } ObjectGuid const& GetReactiveTarget(ReactiveType reactive) const { return m_reactiveTarget[reactive]; } void UpdateReactives(uint32 p_time); float MeleeMissChanceCalc(Unit const* pVictim, WeaponAttackType attType) const; - void CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo *damageInfo, WeaponAttackType attackType = BASE_ATTACK); + void CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK); void UnitDamaged(ObjectGuid from, uint32 damage) { m_damageTakenHistory[from] += damage; m_lastDamageTaken = 0; } - void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss); + void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss); uint32 CalculateDamage(WeaponAttackType attType, bool normalized, uint8 index = 0) const; - uint32 MeleeDamageBonusTaken(WorldObject* pCaster, uint32 pdamage, WeaponAttackType attType, SpellEntry const *spellProto = nullptr, DamageEffectType damagetype = DIRECT_DAMAGE, uint32 stack = 1, Spell* spell = nullptr, bool flat = true); + uint32 MeleeDamageBonusTaken(WorldObject* pCaster, uint32 pdamage, WeaponAttackType attType, SpellEntry const* spellProto = nullptr, DamageEffectType damagetype = DIRECT_DAMAGE, uint32 stack = 1, Spell* spell = nullptr, bool flat = true); MeleeHitOutcome RollMeleeOutcomeAgainst(Unit const* pVictim, WeaponAttackType attType) const; MeleeHitOutcome RollMeleeOutcomeAgainst(Unit const* pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance, bool SpellCasted) const; @@ -1150,7 +1150,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject // Threat related methods bool CanHaveThreatList() const; bool IsSecondaryThreatTarget() const; - void AddThreat(Unit* pVictim, float threat = 0.0f, bool crit = false, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NONE, SpellEntry const *threatSpell = nullptr); + void AddThreat(Unit* pVictim, float threat = 0.0f, bool crit = false, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NONE, SpellEntry const* threatSpell = nullptr); float ApplyTotalThreatModifier(float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL); void RemoveAttackersThreat(Unit* owner); void DeleteThreatList(); @@ -1178,7 +1178,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject uint32 DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const* spellProto, bool durabilityLoss, Spell* spell = nullptr) final; // Called after this unit kills someone. - void Kill(Unit* pVictim, SpellEntry const *spellProto, bool durabilityLoss = true); + void Kill(Unit* pVictim, SpellEntry const* spellProto, bool durabilityLoss = true); void PetOwnerKilledUnit(Unit* pVictim); bool IsInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); } @@ -1219,7 +1219,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject GuardianPetList m_guardianPets; ObjectGuid m_TotemSlot[MAX_TOTEM_SLOT]; protected: - CharmInfo *m_charmInfo; + CharmInfo* m_charmInfo; ObjectGuid m_possessorGuid; // Guid of unit possessing this one public: uint32 GetFactionTemplateId() const final { return GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE); } diff --git a/src/game/Objects/UpdateData.cpp b/src/game/Objects/UpdateData.cpp index 71f4b8108..cd0db69ce 100644 --- a/src/game/Objects/UpdateData.cpp +++ b/src/game/Objects/UpdateData.cpp @@ -66,7 +66,7 @@ void UpdateData::AddUpdateBlock(const ByteBuffer &block) ++it->blockCount; } -void PacketCompressor::Compress(void* dst, uint32 *dst_size, void* src, int src_size) +void PacketCompressor::Compress(void* dst, uint32* dst_size, void* src, int src_size) { z_stream c_stream; @@ -122,14 +122,14 @@ void PacketCompressor::Compress(void* dst, uint32 *dst_size, void* src, int src_ *dst_size = c_stream.total_out; } -bool UpdateData::BuildPacket(WorldPacket *packet, bool hasTransport) +bool UpdateData::BuildPacket(WorldPacket* packet, bool hasTransport) { if (!m_datas.size()) return BuildPacket(packet, nullptr, hasTransport); return BuildPacket(packet, &(m_datas.front()), hasTransport); } -bool UpdateData::BuildPacket(WorldPacket *packet, UpdatePacket const* updPacket, bool hasTransport) +bool UpdateData::BuildPacket(WorldPacket* packet, UpdatePacket const* updPacket, bool hasTransport) { MANGOS_ASSERT(packet->empty()); // shouldn't happen diff --git a/src/game/Objects/UpdateData.h b/src/game/Objects/UpdateData.h index da4a2c0e4..d2b4866ef 100644 --- a/src/game/Objects/UpdateData.h +++ b/src/game/Objects/UpdateData.h @@ -65,7 +65,7 @@ class UpdatePacket class PacketCompressor { public: - static void Compress(void* dst, uint32 *dst_size, void* src, int src_size); + static void Compress(void* dst, uint32* dst_size, void* src, int src_size); }; class UpdateData @@ -75,11 +75,11 @@ class UpdateData ~UpdateData(); void AddOutOfRangeGUID(ObjectGuidSet& guids); - void AddOutOfRangeGUID(ObjectGuid const &guid); - void AddUpdateBlock(const ByteBuffer &block); + void AddOutOfRangeGUID(ObjectGuid const& guid); + void AddUpdateBlock(ByteBuffer const& block); void Send(WorldSession* session, bool hasTransport = false); - bool BuildPacket(WorldPacket *packet, bool hasTransport = false); - bool BuildPacket(WorldPacket *packet, UpdatePacket const* updPacket, bool hasTransport = false); + bool BuildPacket(WorldPacket* packet, bool hasTransport = false); + bool BuildPacket(WorldPacket* packet, UpdatePacket const* updPacket, bool hasTransport = false); bool HasData() { return m_datas.size() || !m_outOfRangeGUIDs.empty(); } void Clear(); diff --git a/src/game/Objects/UpdateMask.h b/src/game/Objects/UpdateMask.h index e472ec677..3f4ab0636 100644 --- a/src/game/Objects/UpdateMask.h +++ b/src/game/Objects/UpdateMask.h @@ -28,10 +28,10 @@ class UpdateMask { public: - UpdateMask( ) : mCount( 0 ), mBlocks( 0 ), mUpdateMask( 0 ) { } - UpdateMask( const UpdateMask& mask ) : mUpdateMask( 0 ) { *this = mask; } + UpdateMask() : mCount(0), mBlocks(0), mUpdateMask(0) { } + UpdateMask(UpdateMask const& mask) : mUpdateMask(0) { *this = mask; } - ~UpdateMask( ) + ~UpdateMask() { delete [] mUpdateMask; } @@ -73,7 +73,7 @@ class UpdateMask memset(mUpdateMask, 0, mBlocks << 2); } - UpdateMask& operator = ( const UpdateMask& mask ) + UpdateMask& operator = (UpdateMask const& mask) { SetCount(mask.mCount); memcpy(mUpdateMask, mask.mUpdateMask, mBlocks << 2); @@ -81,21 +81,21 @@ class UpdateMask return *this; } - void operator &= ( const UpdateMask& mask ) + void operator &= (UpdateMask const& mask) { //MANGOS_ASSERT(mask.mCount <= mCount); for (uint32 i = 0; i < mBlocks; ++i) mUpdateMask[i] &= mask.mUpdateMask[i]; } - void operator |= ( const UpdateMask& mask ) + void operator |= (UpdateMask const& mask) { //MANGOS_ASSERT(mask.mCount <= mCount); for (uint32 i = 0; i < mBlocks; ++i) mUpdateMask[i] |= mask.mUpdateMask[i]; } - UpdateMask operator & ( const UpdateMask& mask ) const + UpdateMask operator & (UpdateMask const& mask) const { //MANGOS_ASSERT(mask.mCount <= mCount); @@ -106,7 +106,7 @@ class UpdateMask return newmask; } - UpdateMask operator | ( const UpdateMask& mask ) const + UpdateMask operator | (UpdateMask const& mask) const { //MANGOS_ASSERT(mask.mCount <= mCount); diff --git a/src/game/OutdoorPvP/OutdoorPvPEP.cpp b/src/game/OutdoorPvP/OutdoorPvPEP.cpp index 93714cfc2..5b132ad9b 100644 --- a/src/game/OutdoorPvP/OutdoorPvPEP.cpp +++ b/src/game/OutdoorPvP/OutdoorPvPEP.cpp @@ -566,7 +566,7 @@ void OPvPCapturePointEP_PWT::SummonFlightMaster(uint32 team) Creature * c = HashMapHolder::Find(m_Creatures[EP_PWT_FLIGHTMASTER]); //Spawn flight master as friendly to capturing team c->SetUInt32Value(GAMEOBJECT_FACTION,(team == ALLIANCE ? 55 : 68)); - if(c) + if (c) { GossipOption gso; gso.Action = GOSSIP_OPTION_OUTDOORPVP; diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h index 16c36b5a1..fb7eb7237 100644 --- a/src/game/QuestDef.h +++ b/src/game/QuestDef.h @@ -207,7 +207,7 @@ class Quest friend class ObjectMgr; public: Quest(Field * questRecord); - uint32 XPValue( Player *pPlayer ) const; + uint32 XPValue(Player *pPlayer) const; uint32 GetQuestFlags() const { return m_QuestFlags; } bool HasQuestFlag(QuestFlags flag) const { return (m_QuestFlags & flag) != 0; } diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp index 6d58e716f..c5836d399 100644 --- a/src/game/ScriptMgr.cpp +++ b/src/game/ScriptMgr.cpp @@ -2128,7 +2128,7 @@ void ScriptMgr::LoadEscortData() // Calcul de uiLastWaypointEntry, et mise en "cache" std::vector const points = GetPointMoveList(pTemp.uiCreatureEntry); - if(points.empty()) + if (points.empty()) { sLog.outErrorDb("Le PNJ %u de script_escort_data n'a pas de donnees de Waypoints !", pTemp.uiCreatureEntry); continue; @@ -2137,7 +2137,7 @@ void ScriptMgr::LoadEscortData() std::vector::const_iterator it; for(it = points.begin(); it != points.end(); ++it) { - if(it->uiPointId > pTemp.uiLastWaypointEntry) + if (it->uiPointId > pTemp.uiLastWaypointEntry) pTemp.uiLastWaypointEntry = it->uiPointId; } m_mEscortDataMap[pTemp.uiCreatureEntry] = pTemp; @@ -2402,9 +2402,9 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget, int32 c { if (sObjectMgr.GetSoundEntry(SoundId)) { - if(Type == CHAT_TYPE_ZONE_YELL) + if (Type == CHAT_TYPE_ZONE_YELL) { - if(Map* pZone = pSource->GetMap()) + if (Map* pZone = pSource->GetMap()) pZone->PlayDirectSoundToMap(SoundId); } else diff --git a/src/game/SocialMgr.cpp b/src/game/SocialMgr.cpp index 8b56fcc1b..52da7d423 100644 --- a/src/game/SocialMgr.cpp +++ b/src/game/SocialMgr.cpp @@ -200,7 +200,7 @@ void SocialMgr::GetFriendInfo(MasterPlayer* player, uint32 friend_lowguid, Frien return; } - MasterPlayer *pFriend = ObjectAccessor::FindMasterPlayer(ObjectGuid(HIGHGUID_PLAYER, friend_lowguid)); + MasterPlayer* pFriend = ObjectAccessor::FindMasterPlayer(ObjectGuid(HIGHGUID_PLAYER, friend_lowguid)); Team team = player->GetTeam(); AccountTypes security = player->GetSession()->GetSecurity(); @@ -236,14 +236,14 @@ void SocialMgr::GetFriendInfo(MasterPlayer* player, uint32 friend_lowguid, Frien } } -void SocialMgr::MakeFriendStatusPacket(FriendsResult result, uint32 guid, WorldPacket *data) +void SocialMgr::MakeFriendStatusPacket(FriendsResult result, uint32 guid, WorldPacket* data) { data->Initialize(SMSG_FRIEND_STATUS, 5); *data << uint8(result); *data << ObjectGuid(HIGHGUID_PLAYER, guid); } -void SocialMgr::SendFriendStatus(MasterPlayer *player, FriendsResult result, ObjectGuid friend_guid, bool broadcast) +void SocialMgr::SendFriendStatus(MasterPlayer* player, FriendsResult result, ObjectGuid friend_guid, bool broadcast) { uint32 friend_lowguid = friend_guid.GetCounter(); @@ -274,7 +274,7 @@ void SocialMgr::SendFriendStatus(MasterPlayer *player, FriendsResult result, Obj player->GetSession()->SendPacket(&data); } -void SocialMgr::BroadcastToFriendListers(MasterPlayer *player, WorldPacket *packet) +void SocialMgr::BroadcastToFriendListers(MasterPlayer* player, WorldPacket* packet) { if (!player) return; @@ -291,7 +291,7 @@ void SocialMgr::BroadcastToFriendListers(MasterPlayer *player, WorldPacket *pack PlayerSocialMap::const_iterator itr2 = itr->second.m_playerSocialMap.find(guid); if (itr2 != itr->second.m_playerSocialMap.end() && (itr2->second.Flags & SOCIAL_FLAG_FRIEND)) { - MasterPlayer *pFriend = ObjectAccessor::FindMasterPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first)); + MasterPlayer* pFriend = ObjectAccessor::FindMasterPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first)); // PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters // MODERATOR, GAME MASTER, ADMINISTRATOR can see all @@ -304,10 +304,10 @@ void SocialMgr::BroadcastToFriendListers(MasterPlayer *player, WorldPacket *pack } } -PlayerSocial *SocialMgr::LoadFromDB(QueryResult *result, ObjectGuid guid) +PlayerSocial* SocialMgr::LoadFromDB(QueryResult* result, ObjectGuid guid) { ACE_Guard guard(_socialMapLock); - PlayerSocial *social = &m_socialMap[guid.GetCounter()]; + PlayerSocial* social = &m_socialMap[guid.GetCounter()]; social->SetPlayerGuid(guid); if (!result) @@ -321,7 +321,7 @@ PlayerSocial *SocialMgr::LoadFromDB(QueryResult *result, ObjectGuid guid) do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); friend_guid = fields[0].GetUInt32(); flags = fields[1].GetUInt32(); diff --git a/src/game/SocialMgr.h b/src/game/SocialMgr.h index e1f9caf41..1f1d4afef 100644 --- a/src/game/SocialMgr.h +++ b/src/game/SocialMgr.h @@ -147,13 +147,13 @@ class SocialMgr // Misc void RemovePlayerSocial(uint32 guid); - void GetFriendInfo(MasterPlayer *player, uint32 friendGUID, FriendInfo &friendInfo); + void GetFriendInfo(MasterPlayer* player, uint32 friendGUID, FriendInfo &friendInfo); // Packet management - void MakeFriendStatusPacket(FriendsResult result, uint32 friend_guid, WorldPacket *data); - void SendFriendStatus(MasterPlayer *player, FriendsResult result, ObjectGuid friend_guid, bool broadcast); - void BroadcastToFriendListers(MasterPlayer *player, WorldPacket *packet); + void MakeFriendStatusPacket(FriendsResult result, uint32 friend_guid, WorldPacket* data); + void SendFriendStatus(MasterPlayer* player, FriendsResult result, ObjectGuid friend_guid, bool broadcast); + void BroadcastToFriendListers(MasterPlayer* player, WorldPacket* packet); // Loading - PlayerSocial *LoadFromDB(QueryResult *result, ObjectGuid guid); + PlayerSocial* LoadFromDB(QueryResult* result, ObjectGuid guid); private: SocialMap m_socialMap; diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index cad7deab5..fb090b6c5 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -662,7 +662,7 @@ void Spell::prepareDataForTriggerSystem() //========================================================================================== // Now fill data for trigger system, need know: // an spell trigger another or not ( m_canTrigger ) - // Create base triggers flags for Attacker and Victim ( m_procAttacker and m_procVictim) + // Create base triggers flags for Attacker and Victim (m_procAttacker and m_procVictim) //========================================================================================== // Fill flag can spell trigger or not // TODO: possible exist spell attribute for this @@ -3093,7 +3093,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& /*[-ZERO] if (m_spellInfo->EffectMiscValueB[effIndex] == SUMMON_TYPE_POSESSED || m_spellInfo->EffectMiscValueB[effIndex] == SUMMON_TYPE_POSESSED2) { - if(m_targets.getUnitTarget()) + if (m_targets.getUnitTarget()) targetUnitMap.push_back(m_targets.getUnitTarget()); } else */ @@ -3240,7 +3240,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& m_targets.setDestination(x, y, z); } default: - //sLog.outError( "SPELL: Unknown implicit target (%u) for spell ID %u", targetMode, m_spellInfo->Id ); + //sLog.outError("SPELL: Unknown implicit target (%u) for spell ID %u", targetMode, m_spellInfo->Id); break; } @@ -6332,7 +6332,7 @@ SpellCastResult Spell::CheckCast(bool strict) { if (go->GetGoState() != GO_STATE_READY) return SPELL_FAILED_BAD_TARGETS; - if(!((Player*)m_caster)->CanUseBattleGroundObject()) + if (!((Player*)m_caster)->CanUseBattleGroundObject()) return SPELL_FAILED_TRY_AGAIN; } lockId = go->GetGOInfo()->GetLockId(); diff --git a/src/game/Spells/Spell.h b/src/game/Spells/Spell.h index a39ea0964..d340042bd 100644 --- a/src/game/Spells/Spell.h +++ b/src/game/Spells/Spell.h @@ -97,8 +97,8 @@ class SpellCastTargets SpellCastTargets(); ~SpellCastTargets(); - void read( ByteBuffer& data, Unit *caster ); - void write( ByteBuffer& data ) const; + void read(ByteBuffer& data, Unit *caster); + void write(ByteBuffer& data) const; SpellCastTargetsReader ReadForCaster(Unit* caster) { return SpellCastTargetsReader(*this,caster); } @@ -152,7 +152,7 @@ class SpellCastTargets void setTradeItemTarget(Player* caster); void updateTradeSlotItem() { - if(m_itemTarget && (m_targetMask & TARGET_FLAG_TRADE_ITEM)) + if (m_itemTarget && (m_targetMask & TARGET_FLAG_TRADE_ITEM)) { m_itemTargetGUID = m_itemTarget->GetObjectGuid(); m_itemTargetEntry = m_itemTarget->GetEntry(); @@ -378,11 +378,11 @@ class Spell void SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList &targetUnitMap); void FillAreaTargets(UnitList &targetUnitMap, float radius, SpellNotifyPushType pushType, SpellTargets spellTargets, WorldObject* originalCaster = nullptr); - void FillRaidOrPartyTargets( UnitList &TagUnitMap, Unit* target, float radius, bool raid, bool withPets, bool withcaster ) const; + void FillRaidOrPartyTargets(UnitList &TagUnitMap, Unit* target, float radius, bool raid, bool withPets, bool withcaster) const; template WorldObject* FindCorpseUsing(); - bool CheckTarget( Unit* target, SpellEffectIndex eff ); + bool CheckTarget(Unit* target, SpellEffectIndex eff); bool CanAutoCast(Unit* target); static void MANGOS_DLL_SPEC SendCastResult(Player* caster, SpellEntry const* spellInfo, SpellCastResult result); @@ -756,19 +756,19 @@ namespace MaNGOS void Visit(PlayerMapType &m) { - if(!i_originalCaster) + if (!i_originalCaster) return; for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) { Player * pPlayer = itr->getSource(); - if( !pPlayer->IsAlive() || pPlayer->IsTaxiFlying()) + if (!pPlayer->IsAlive() || pPlayer->IsTaxiFlying()) continue; - if( i_originalCaster->IsFriendlyTo(pPlayer) ) + if (i_originalCaster->IsFriendlyTo(pPlayer)) continue; - if( pPlayer->IsWithinDist3d(i_spell.m_targets.m_destX, i_spell.m_targets.m_destY, i_spell.m_targets.m_destZ,i_radius)) + if (pPlayer->IsWithinDist3d(i_spell.m_targets.m_destX, i_spell.m_targets.m_destY, i_spell.m_targets.m_destZ,i_radius)) i_data.push_back(pPlayer); } } diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index 12303a76b..d4163e362 100644 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -3289,7 +3289,7 @@ void Aura::HandleModCharm(bool apply, bool Real) // Charmed players are seen as hostile and not in the group for other clients, restore // group upon charm end - if(pPlayerTarget->GetGroup()) + if (pPlayerTarget->GetGroup()) pPlayerTarget->GetGroup()->BroadcastGroupUpdate(); } } @@ -6474,7 +6474,7 @@ void SpellAuraHolder::_RemoveSpellAuraHolder() //passive auras do not get put in slots // Note: but totem can be not accessible for aura target in time remove (to far for find in grid) - //if(m_isPassive && !(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem())) + //if (m_isPassive && !(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem())) // return false; uint8 slot = GetAuraSlot(); diff --git a/src/game/Spells/SpellAuras.h b/src/game/Spells/SpellAuras.h index ce5b6e418..18cfa30e4 100644 --- a/src/game/Spells/SpellAuras.h +++ b/src/game/Spells/SpellAuras.h @@ -159,11 +159,11 @@ class MANGOS_DLL_SPEC SpellAuraHolder void SetInUse(bool state) { - if(state) + if (state) ++m_in_use; else { - if(m_in_use) + if (m_in_use) --m_in_use; } } @@ -276,15 +276,15 @@ typedef void(Aura::*pAuraHandler)(bool Apply, bool Real); // Real == true at aura add/remove // Real == false at aura mod unapply/reapply; when adding/removing dependent aura/item/stat mods // -// Code in aura handler can be guarded by if(Real) check if it should execution only at real add/remove of aura +// Code in aura handler can be guarded by if (Real) check if it should execution only at real add/remove of aura // -// MAIN RULE: Code MUST NOT be guarded by if(Real) check if it modifies any stats +// MAIN RULE: Code MUST NOT be guarded by if (Real) check if it modifies any stats // (percent auras, stats mods, etc) -// Second rule: Code must be guarded by if(Real) check if it modifies object state (start/stop attack, send packets to client, etc) +// Second rule: Code must be guarded by if (Real) check if it modifies object state (start/stop attack, send packets to client, etc) // -// Other case choice: each code line moved under if(Real) check is mangos speedup, -// each setting object update field code line moved under if(Real) check is significant mangos speedup, and less server->client data sends -// each packet sending code moved under if(Real) check is _large_ mangos speedup, and lot less server->client data sends +// Other case choice: each code line moved under if (Real) check is mangos speedup, +// each setting object update field code line moved under if (Real) check is significant mangos speedup, and less server->client data sends +// each packet sending code moved under if (Real) check is _large_ mangos speedup, and lot less server->client data sends class MANGOS_DLL_SPEC Aura { @@ -466,7 +466,7 @@ class MANGOS_DLL_SPEC Aura m_modifier.m_amount = damage; m_modifier.periodictime = periodicTime; - if(uint32 maxticks = GetAuraMaxTicks()) + if (uint32 maxticks = GetAuraMaxTicks()) m_periodicTick = maxticks - GetAuraDuration() / m_modifier.periodictime; } @@ -496,11 +496,11 @@ class MANGOS_DLL_SPEC Aura void SetInUse(bool state) { - if(state) + if (state) ++m_in_use; else { - if(m_in_use) + if (m_in_use) --m_in_use; } } diff --git a/src/game/Spells/SpellDefines.h b/src/game/Spells/SpellDefines.h index 39ef59f51..e08138ddf 100644 --- a/src/game/Spells/SpellDefines.h +++ b/src/game/Spells/SpellDefines.h @@ -704,7 +704,7 @@ inline SpellSchoolMask GetSchoolMask(uint32 school) inline SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask) { for(int i = 0; i < MAX_SPELL_SCHOOL; ++i) - if(mask & (1 << i)) + if (mask & (1 << i)) return SpellSchools(i); return SPELL_SCHOOL_NORMAL; diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 29d9b72f6..de1744e49 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -6499,7 +6499,7 @@ void Spell::EffectTransmitted(SpellEffectIndex eff_idx) pGameObj->SetOwnerGuid(m_casterUnit->GetObjectGuid()); if (m_casterUnit->GetTypeId() == TYPEID_PLAYER) { - if(Group * group = ((Player*)m_casterUnit)->GetGroup()) + if (Group * group = ((Player*)m_casterUnit)->GetGroup()) pGameObj->SetOwnerGroupId(group->GetId()); } pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_casterUnit->GetLevel()); diff --git a/src/game/Spells/SpellEntry.h b/src/game/Spells/SpellEntry.h index 2c6570a5e..50f601f91 100644 --- a/src/game/Spells/SpellEntry.h +++ b/src/game/Spells/SpellEntry.h @@ -247,7 +247,7 @@ namespace Spells inline bool IsCasterSourceTarget(uint32 target) { - switch (target ) + switch (target) { case TARGET_SELF: case TARGET_PET: @@ -272,7 +272,7 @@ namespace Spells inline bool IsPointEffectTarget(SpellTarget target) { - switch (target ) + switch (target) { case TARGET_INNKEEPER_COORDINATES: case TARGET_TABLE_X_Y_Z_COORDINATES: @@ -289,7 +289,7 @@ namespace Spells inline bool IsAreaEffectPossitiveTarget(SpellTarget target) { - switch (target ) + switch (target) { case TARGET_ALL_PARTY_AROUND_CASTER: case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER: @@ -308,7 +308,7 @@ namespace Spells inline bool IsAreaEffectTarget(SpellTarget target) { - switch (target ) + switch (target) { case TARGET_AREAEFFECT_INSTANT: case TARGET_AREAEFFECT_CUSTOM: diff --git a/src/game/Spells/SpellMgr.cpp b/src/game/Spells/SpellMgr.cpp index 8e02f072b..218e8dbde 100644 --- a/src/game/Spells/SpellMgr.cpp +++ b/src/game/Spells/SpellMgr.cpp @@ -2294,17 +2294,17 @@ void SpellMgr::LoadSpellScriptTarget() for(uint32 i = 1; i < sSpellMgr.GetMaxSpellId; ++i) { SpellEntry const * spellInfo = sSpellMgr.GetSpellEntry(i); - if(!spellInfo) + if (!spellInfo) continue; bool found = false; for(int j = 0; j < MAX_EFFECT_INDEX; ++j) { - if( spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT || spellInfo->EffectImplicitTargetA[j] != TARGET_SELF && spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT ) + if (spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT || spellInfo->EffectImplicitTargetA[j] != TARGET_SELF && spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT) { SpellScriptTarget::const_iterator lower = GetBeginSpellScriptTarget(spellInfo->Id); SpellScriptTarget::const_iterator upper = GetEndSpellScriptTarget(spellInfo->Id); - if(lower==upper) + if (lower==upper) { sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = %u (TARGET_SCRIPT), but does not have record in `spell_script_target`",spellInfo->Id,TARGET_SCRIPT); break; // effects of spell diff --git a/src/game/Spells/SpellMgr.h b/src/game/Spells/SpellMgr.h index 414133b41..85bc3416f 100644 --- a/src/game/Spells/SpellMgr.h +++ b/src/game/Spells/SpellMgr.h @@ -256,12 +256,12 @@ class PetAura uint32 GetAura(uint32 petEntry) const { std::map::const_iterator itr = auras.find(petEntry); - if(itr != auras.end()) + if (itr != auras.end()) return itr->second; else { std::map::const_iterator itr2 = auras.find(0); - if(itr2 != auras.end()) + if (itr2 != auras.end()) return itr2->second; else return 0; @@ -358,10 +358,10 @@ typedef std::paircategoryId != SKILL_CATEGORY_PROFESSION) + if (pSkill->categoryId != SKILL_CATEGORY_PROFESSION) return false; return true; @@ -508,7 +508,7 @@ class SpellMgr uint32 GetSpellElixirMask(uint32 spellid) const { SpellElixirMap::const_iterator itr = mSpellElixirs.find(spellid); - if(itr==mSpellElixirs.end()) + if (itr==mSpellElixirs.end()) return 0x0; return itr->second; @@ -519,9 +519,9 @@ class SpellMgr uint32 mask = GetSpellElixirMask(spellid); // flasks must have all bits set from ELIXIR_FLASK_MASK - if((mask & ELIXIR_FLASK_MASK)==ELIXIR_FLASK_MASK) + if ((mask & ELIXIR_FLASK_MASK)==ELIXIR_FLASK_MASK) return SPELL_FLASK_ELIXIR; - else if(mask & ELIXIR_WELL_FED) + else if (mask & ELIXIR_WELL_FED) return SPELL_WELL_FED; else return SPELL_NORMAL; @@ -560,7 +560,7 @@ class SpellMgr SpellProcEventEntry const* GetSpellProcEvent(uint32 spellId) const { SpellProcEventMap::const_iterator itr = mSpellProcEventMap.find(spellId); - if( itr != mSpellProcEventMap.end( ) ) + if (itr != mSpellProcEventMap.end()) return &itr->second; return nullptr; } @@ -569,20 +569,20 @@ class SpellMgr float GetItemEnchantProcChance(uint32 spellid) const { SpellProcItemEnchantMap::const_iterator itr = mSpellProcItemEnchantMap.find(spellid); - if(itr==mSpellProcItemEnchantMap.end()) + if (itr==mSpellProcItemEnchantMap.end()) return 0.0f; return itr->second; } - static bool IsSpellProcEventCanTriggeredBy( SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra); + static bool IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra); // Spell bonus data SpellBonusEntry const* GetSpellBonusData(uint32 spellId) const { // Lookup data SpellBonusMap::const_iterator itr = mSpellBonusMap.find(spellId); - if( itr != mSpellBonusMap.end( ) ) + if (itr != mSpellBonusMap.end()) return &itr->second; return nullptr; @@ -591,8 +591,8 @@ class SpellMgr // Spell target coordinates SpellTargetPosition const* GetSpellTargetPosition(uint32 spell_id) const { - SpellTargetPositionMap::const_iterator itr = mSpellTargetPositions.find( spell_id ); - if( itr != mSpellTargetPositions.end( ) ) + SpellTargetPositionMap::const_iterator itr = mSpellTargetPositions.find(spell_id); + if (itr != mSpellTargetPositions.end()) return &itr->second; return nullptr; } @@ -601,7 +601,7 @@ class SpellMgr SpellChainNode const* GetSpellChainNode(uint32 spell_id) const { SpellChainMap::const_iterator itr = mSpellChains.find(spell_id); - if(itr == mSpellChains.end()) + if (itr == mSpellChains.end()) return nullptr; return &itr->second; @@ -609,7 +609,7 @@ class SpellMgr uint32 GetFirstSpellInChain(uint32 spell_id) const { - if(SpellChainNode const* node = GetSpellChainNode(spell_id)) + if (SpellChainNode const* node = GetSpellChainNode(spell_id)) return node->first; return spell_id; @@ -617,7 +617,7 @@ class SpellMgr uint32 GetPrevSpellInChain(uint32 spell_id) const { - if(SpellChainNode const* node = GetSpellChainNode(spell_id)) + if (SpellChainNode const* node = GetSpellChainNode(spell_id)) return node->prev; return 0; @@ -640,7 +640,7 @@ class SpellMgr // Use IsHighRankOfSpell instead uint8 GetSpellRank(uint32 spell_id) const { - if(SpellChainNode const* node = GetSpellChainNode(spell_id)) + if (SpellChainNode const* node = GetSpellChainNode(spell_id)) return node->rank; return 0; @@ -653,12 +653,12 @@ class SpellMgr uint32 rank2 = GetSpellRank(spell2); // not ordered correctly by rank value - if(itr == mSpellChains.end() || !rank2 || itr->second.rank <= rank2) + if (itr == mSpellChains.end() || !rank2 || itr->second.rank <= rank2) return false; // check present in same rank chain for(; itr != mSpellChains.end(); itr = mSpellChains.find(itr->second.prev)) - if(itr->second.prev==spell2) + if (itr->second.prev==spell2) return true; return false; @@ -687,7 +687,7 @@ class SpellMgr SpellLearnSkillNode const* GetSpellLearnSkill(uint32 spell_id) const { SpellLearnSkillMap::const_iterator itr = mSpellLearnSkills.find(spell_id); - if(itr != mSpellLearnSkills.end()) + if (itr != mSpellLearnSkills.end()) return &itr->second; else return nullptr; @@ -747,7 +747,7 @@ class SpellMgr PetAura const* GetPetAura(uint32 spell_id) { SpellPetAuraMap::const_iterator itr = mSpellPetAuraMap.find(spell_id); - if(itr != mSpellPetAuraMap.end()) + if (itr != mSpellPetAuraMap.end()) return &itr->second; else return nullptr; diff --git a/src/game/Threat/HostileRefManager.h b/src/game/Threat/HostileRefManager.h index 925df1ade..bafe8881e 100644 --- a/src/game/Threat/HostileRefManager.h +++ b/src/game/Threat/HostileRefManager.h @@ -57,7 +57,7 @@ class HostileRefManager : public RefManager // Remove specific faction references void deleteReferencesForFaction(uint32 faction); - HostileReference* getFirst() { return ((HostileReference* ) RefManager::getFirst()); } + HostileReference* getFirst() { return ((HostileReference*) RefManager::getFirst()); } void updateThreatTables(); diff --git a/src/game/Threat/ThreatManager.h b/src/game/Threat/ThreatManager.h index a933f4480..8612e4532 100644 --- a/src/game/Threat/ThreatManager.h +++ b/src/game/Threat/ThreatManager.h @@ -73,12 +73,12 @@ class MANGOS_DLL_SPEC HostileReference : public Reference // used for temporary setting a threat and reducting it later again. // the threat modification is stored - void setTempThreat(float pThreat) { iTempThreatModifyer = pThreat - getThreat(); if(iTempThreatModifyer != 0.0f) addThreat(iTempThreatModifyer); } + void setTempThreat(float pThreat) { iTempThreatModifyer = pThreat - getThreat(); if (iTempThreatModifyer != 0.0f) addThreat(iTempThreatModifyer); } void setTempThreatModifier(float thread) { iTempThreatModifyer = thread; addThreat(iTempThreatModifyer); } void resetTempThreat() { - if(iTempThreatModifyer != 0.0f) + if (iTempThreatModifyer != 0.0f) { addThreat(-iTempThreatModifyer); iTempThreatModifyer = 0.0f; } @@ -110,7 +110,7 @@ class MANGOS_DLL_SPEC HostileReference : public Reference //================================================= - HostileReference* next() { return ((HostileReference* ) Reference::next()); } + HostileReference* next() { return ((HostileReference*) Reference::next()); } //================================================= diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index c942d8d6d..f696e6135 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -828,7 +828,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura igniteHolder->SetStackAmount(5); // Refresh Ignite Stack - igniteHolder->Refresh(igniteAura->GetCaster(), target, igniteHolder ); + igniteHolder->Refresh(igniteAura->GetCaster(), target, igniteHolder); return SPELL_AURA_PROC_OK; } diff --git a/src/game/UnitEvents.h b/src/game/UnitEvents.h index 7e4dc94a3..973c5dce9 100644 --- a/src/game/UnitEvents.h +++ b/src/game/UnitEvents.h @@ -55,7 +55,7 @@ enum UnitThreatEventType UEV_THREAT_VICTIM_CHANGED = 1<<6, }; -#define UEV_THREAT_REF_EVENT_MASK ( UEV_THREAT_REF_ONLINE_STATUS | UEV_THREAT_REF_THREAT_CHANGE | UEV_THREAT_REF_REMOVE_FROM_LIST | UEV_THREAT_REF_ASSECCIBLE_STATUS) +#define UEV_THREAT_REF_EVENT_MASK (UEV_THREAT_REF_ONLINE_STATUS | UEV_THREAT_REF_THREAT_CHANGE | UEV_THREAT_REF_REMOVE_FROM_LIST | UEV_THREAT_REF_ASSECCIBLE_STATUS) #define UEV_THREAT_MANAGER_EVENT_MASK (UEV_THREAT_SORT_LIST | UEV_THREAT_SET_NEXT_TARGET | UEV_THREAT_VICTIM_CHANGED) #define UEV_ALL_EVENT_MASK (0xffffffff) diff --git a/src/game/World.cpp b/src/game/World.cpp index b2306ab65..f432735a7 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -174,7 +174,7 @@ World::~World() void World::Shutdown() { sWorld.KickAll(); // save and kick all players - sWorld.UpdateSessions( 1 ); // real players unload required UpdateSessions call + sWorld.UpdateSessions(1); // real players unload required UpdateSessions call if (m_charDbWorkerThread) m_charDbWorkerThread->wait(); } @@ -2005,7 +2005,7 @@ void World::Update(uint32 diff) } /// Send a packet to all players (except self if mentioned) -void World::SendGlobalMessage(WorldPacket *packet, WorldSession *self, uint32 team) +void World::SendGlobalMessage(WorldPacket* packet, WorldSession* self, uint32 team) { for (const auto& itr : m_sessions) { @@ -2177,7 +2177,7 @@ void World::SendGlobalText(const char* text, WorldSession *self) } /// Send a packet to all players (or players selected team) in the zone (except self if mentioned) -void World::SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self, uint32 team) +void World::SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self, uint32 team) { for (const auto& itr : m_sessions) { diff --git a/src/game/World.h b/src/game/World.h index adadc8b56..5c1e905b3 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -786,8 +786,8 @@ class World void SendGMTicketText(const char* text); void SendGMText(int32 string_id, ...); void SendGlobalText(const char* text, WorldSession *self); - void SendGlobalMessage(WorldPacket *packet, WorldSession *self = 0, uint32 team = 0); - void SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self = 0, uint32 team = 0); + void SendGlobalMessage(WorldPacket* packet, WorldSession* self = 0, uint32 team = 0); + void SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self = 0, uint32 team = 0); void SendZoneText(uint32 zone, const char *text, WorldSession *self = 0, uint32 team = 0); void SendServerMessage(ServerMessageType type, const char *text = "", Player* player = nullptr); @@ -802,7 +802,7 @@ class World void Update(uint32 diff); - void UpdateSessions( uint32 diff ); + void UpdateSessions(uint32 diff); /// Get a server configuration element (see #eConfigFloatValues) void setConfig(eConfigFloatValues index,float value) { m_configFloatValues[index]=value; } @@ -858,7 +858,7 @@ class World void UpdateRealmCharCount(uint32 accid); - LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const { if(m_availableDbcLocaleMask & (1 << locale)) return locale; else return m_defaultDbcLocale; } + LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const { if (m_availableDbcLocaleMask & (1 << locale)) return locale; else return m_defaultDbcLocale; } // Nostalrius MovementBroadcaster* GetBroadcaster() { return m_broadcaster.get(); } diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 0d393ade2..1ec368039 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -65,7 +65,7 @@ static bool MapSessionFilterHelper(WorldSession* session, OpcodeHandler const& o } -bool MapSessionFilter::Process(WorldPacket * packet) +bool MapSessionFilter::Process(WorldPacket* packet) { OpcodeHandler const& opHandle = opcodeTable[packet->GetOpcode()]; // let's check if our opcode can be really processed in Map::Update() @@ -282,7 +282,7 @@ void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char *reason) } /// Logging helper for unexpected opcodes -void WorldSession::LogUnprocessedTail(WorldPacket *packet) +void WorldSession::LogUnprocessedTail(WorldPacket* packet) { sLog.outError("SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at " SIZEFMTD " from " SIZEFMTD ")", LookupOpcodeName(packet->GetOpcode()), @@ -314,7 +314,7 @@ bool WorldSession::Update(PacketFilter& updater) ///- Retrieve packets from the receive queue and call the appropriate handlers ProcessPackets(updater); - if(CharacterScreenIdleKick(sessionUpdateTime)) + if (CharacterScreenIdleKick(sessionUpdateTime)) return false; sessionUpdateTime = WorldTimer::getMSTimeDiffToNow(sessionUpdateTime); @@ -558,12 +558,12 @@ void WorldSession::ProcessPackets(PacketFilter& updater) if (sWorld.getConfig(CONFIG_UINT32_PERFLOG_SLOW_PACKET) && packetTime > sWorld.getConfig(CONFIG_UINT32_PERFLOG_SLOW_PACKET)) sLog.out(LOG_PERFORMANCE, "Slow packet opcode %s: %ums. Account %u on IP %s", opHandle.name, packetTime, GetAccountId(), GetRemoteAddress().c_str()); } - catch (ForwardToMaster_Exception& ) + catch (ForwardToMaster_Exception&) { ASSERT(GetMasterSession()); GetMasterSession()->ForwardClientPacket(GetAccountId(), packet); } - catch (ForwardToNode_Exception& ) + catch (ForwardToNode_Exception&) { ASSERT(GetNodeSession()); GetMasterSession()->ForwardClientPacket(GetAccountId(), packet); diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 5378b2612..32c9cf394 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -213,7 +213,7 @@ class PacketFilter explicit PacketFilter(WorldSession * pSession) : m_pSession(pSession), m_processLogout(false), m_processType(PACKET_PROCESS_MAX_TYPE) {} virtual ~PacketFilter() {} - virtual bool Process(WorldPacket *) { return true; } + virtual bool Process(WorldPacket* ) { return true; } inline bool ProcessLogout() const { return m_processLogout; } inline PacketProcessing PacketProcessType() const { return m_processType; } inline void SetProcessType(PacketProcessing t) { m_processType = t; } @@ -234,7 +234,7 @@ class MapSessionFilter : public PacketFilter } ~MapSessionFilter() override {} - bool Process(WorldPacket * packet) override; + bool Process(WorldPacket* packet) override; }; //class used to filer only thread-unsafe packets from queue @@ -351,7 +351,7 @@ class MANGOS_DLL_SPEC WorldSession static void SendNameQueryOpcodeFromDBCallBack(QueryResult *result, uint32 accountId); void SendTrainerList(ObjectGuid guid); - void SendTrainerList(ObjectGuid guid, std::string const& strTitle ); + void SendTrainerList(ObjectGuid guid, std::string const& strTitle); void SendTrainingSuccess(ObjectGuid guid, uint32 spellId); void SendTrainingFailure(ObjectGuid guid, uint32 serviceId, uint32 errorCode); @@ -390,15 +390,15 @@ class MANGOS_DLL_SPEC WorldSession void SetTutorialInt(uint32 intId, uint32 value) { - if(m_Tutorials[intId] != value) + if (m_Tutorials[intId] != value) { m_Tutorials[intId] = value; - if(m_tutorialState == TUTORIALDATA_UNCHANGED) + if (m_tutorialState == TUTORIALDATA_UNCHANGED) m_tutorialState = TUTORIALDATA_CHANGED; } } - bool SendItemInfo( uint32 itemid, WorldPacket data ); + bool SendItemInfo(uint32 itemid, WorldPacket data); //auction void SendAuctionHello(Unit *unit); @@ -416,21 +416,21 @@ class MANGOS_DLL_SPEC WorldSession //Taxi void SendTaxiStatus(ObjectGuid guid); - void SendTaxiMenu( Creature* unit ); - void SendDoFlight( uint32 mountDisplayId, uint32 path, uint32 pathNode = 0 ); - bool SendLearnNewTaxiNode( Creature* unit ); + void SendTaxiMenu(Creature* unit); + void SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathNode = 0); + bool SendLearnNewTaxiNode(Creature* unit); // Guild Team void SendGuildCommandResult(uint32 typecmd, std::string const& str, uint32 cmdresult); void SendPetitionShowList(ObjectGuid& guid); - void SendSaveGuildEmblem( uint32 msg ); + void SendSaveGuildEmblem(uint32 msg); void SendBattleGroundJoinError(uint8 err); // Meetingstone void SendMeetingstoneFailed(uint8 status); void SendMeetingstoneSetqueue(uint32 areaid, uint8 status); - void BuildPartyMemberStatsChangedPacket(Player *player, WorldPacket *data); + void BuildPartyMemberStatsChangedPacket(Player *player, WorldPacket* data); void BuildPartyMemberStatsPacket(Player* player, WorldPacket* data, uint32 updateMask, bool sendAllAuras); void DoLootRelease(ObjectGuid lguid); @@ -550,7 +550,7 @@ class MANGOS_DLL_SPEC WorldSession public: // opcodes handlers void Handle_NULL(WorldPacket& recvPacket); // not used - void Handle_EarlyProccess( WorldPacket& recvPacket);// just mark packets processed in WorldSocket::OnRead + void Handle_EarlyProccess(WorldPacket& recvPacket);// just mark packets processed in WorldSocket::OnRead void Handle_ServerSide(WorldPacket& recvPacket); // sever side only, can't be accepted from client void Handle_Deprecated(WorldPacket& recvPacket); // never used anymore by client @@ -622,7 +622,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleItemNameQueryOpcode(WorldPacket& recvPacket); void HandleAreaTriggerOpcode(WorldPacket& recvPacket); - void HandleSetFactionAtWarOpcode( WorldPacket & recv_data ); + void HandleSetFactionAtWarOpcode(WorldPacket & recv_data); void HandleSetWatchedFactionOpcode(WorldPacket & recv_data); void HandleSetFactionInactiveOpcode(WorldPacket & recv_data); @@ -640,7 +640,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleCreatureQueryOpcode(WorldPacket& recvPacket); void HandleGameObjectQueryOpcode(WorldPacket& recvPacket); - void HandleRequestRaidInfoOpcode( WorldPacket & recv_data ); + void HandleRequestRaidInfoOpcode(WorldPacket & recv_data); void HandleGroupInviteOpcode(WorldPacket& recvPacket); void HandleGroupAcceptOpcode(WorldPacket& recvPacket); void HandleGroupDeclineOpcode(WorldPacket& recvPacket); @@ -649,14 +649,14 @@ class MANGOS_DLL_SPEC WorldSession void HandleGroupSetLeaderOpcode(WorldPacket& recvPacket); void HandleGroupDisbandOpcode(WorldPacket& recvPacket); void HandleLootMethodOpcode(WorldPacket& recvPacket); - void HandleLootRoll( WorldPacket &recv_data ); - void HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data ); - void HandleRaidTargetUpdateOpcode( WorldPacket & recv_data ); - void HandleRaidReadyCheckOpcode( WorldPacket & recv_data ); - void HandleGroupRaidConvertOpcode( WorldPacket & recv_data ); - void HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data ); - void HandleGroupSwapSubGroupOpcode( WorldPacket & recv_data ); - void HandleGroupAssistantLeaderOpcode( WorldPacket & recv_data ); + void HandleLootRoll(WorldPacket &recv_data); + void HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data); + void HandleRaidTargetUpdateOpcode(WorldPacket & recv_data); + void HandleRaidReadyCheckOpcode(WorldPacket & recv_data); + void HandleGroupRaidConvertOpcode(WorldPacket & recv_data); + void HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data); + void HandleGroupSwapSubGroupOpcode(WorldPacket & recv_data); + void HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data); void HandlePetitionBuyOpcode(WorldPacket& recv_data); void HandlePetitionShowSignOpcode(WorldPacket& recv_data); @@ -727,28 +727,28 @@ class MANGOS_DLL_SPEC WorldSession void HandleUnacceptTradeOpcode(WorldPacket& recvPacket); void HandleAuctionHelloOpcode(WorldPacket& recvPacket); - void HandleAuctionListItems( WorldPacket & recv_data ); - void HandleAuctionListBidderItems( WorldPacket & recv_data ); - void HandleAuctionSellItem( WorldPacket & recv_data ); - void HandleAuctionRemoveItem( WorldPacket & recv_data ); - void HandleAuctionListOwnerItems( WorldPacket & recv_data ); - void HandleAuctionPlaceBid( WorldPacket & recv_data ); + void HandleAuctionListItems(WorldPacket & recv_data); + void HandleAuctionListBidderItems(WorldPacket & recv_data); + void HandleAuctionSellItem(WorldPacket & recv_data); + void HandleAuctionRemoveItem(WorldPacket & recv_data); + void HandleAuctionListOwnerItems(WorldPacket & recv_data); + void HandleAuctionPlaceBid(WorldPacket & recv_data); - void HandleGetMailList( WorldPacket & recv_data ); - void HandleSendMail( WorldPacket & recv_data ); + void HandleGetMailList(WorldPacket & recv_data); + void HandleSendMail(WorldPacket & recv_data); class AsyncMailSendRequest; void HandleSendMailCallback(AsyncMailSendRequest* req); - void HandleMailTakeMoney( WorldPacket & recv_data ); - void HandleMailTakeItem( WorldPacket & recv_data ); - void HandleMailMarkAsRead( WorldPacket & recv_data ); - void HandleMailReturnToSender( WorldPacket & recv_data ); - void HandleMailDelete( WorldPacket & recv_data ); - void HandleItemTextQuery( WorldPacket & recv_data); - void HandleMailCreateTextItem(WorldPacket & recv_data ); - void HandleQueryNextMailTime(WorldPacket & recv_data ); - void HandleCancelChanneling(WorldPacket & recv_data ); + void HandleMailTakeMoney(WorldPacket & recv_data); + void HandleMailTakeItem(WorldPacket & recv_data); + void HandleMailMarkAsRead(WorldPacket & recv_data); + void HandleMailReturnToSender(WorldPacket & recv_data); + void HandleMailDelete(WorldPacket & recv_data); + void HandleItemTextQuery(WorldPacket & recv_data); + void HandleMailCreateTextItem(WorldPacket & recv_data); + void HandleQueryNextMailTime(WorldPacket & recv_data); + void HandleCancelChanneling(WorldPacket & recv_data); - void SendItemPageInfo( ItemPrototype *itemProto ); + void SendItemPageInfo(ItemPrototype *itemProto); void HandleSplitItemOpcode(WorldPacket& recvPacket); void HandleSwapInvItemOpcode(WorldPacket& recvPacket); void HandleDestroyItemOpcode(WorldPacket& recvPacket); @@ -761,7 +761,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleAutoStoreBagItemOpcode(WorldPacket& recvPacket); void HandleReadItemOpcode(WorldPacket& recvPacket); void HandleAutoEquipItemSlotOpcode(WorldPacket & recvPacket); - void HandleSwapItem( WorldPacket & recvPacket); + void HandleSwapItem(WorldPacket & recvPacket); void HandleBuybackItem(WorldPacket & recvPacket); void HandleAutoBankItemOpcode(WorldPacket& recvPacket); void HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket); @@ -790,8 +790,8 @@ class MANGOS_DLL_SPEC WorldSession void HandleQuestgiverChooseRewardOpcode(WorldPacket& recvPacket); void HandleQuestgiverRequestRewardOpcode(WorldPacket& recvPacket); void HandleQuestQueryOpcode(WorldPacket& recvPacket); - void HandleQuestgiverCancel(WorldPacket& recv_data ); - void HandleQuestLogSwapQuest(WorldPacket& recv_data ); + void HandleQuestgiverCancel(WorldPacket& recv_data); + void HandleQuestLogSwapQuest(WorldPacket& recv_data); void HandleQuestLogRemoveQuest(WorldPacket& recv_data); void HandleQuestConfirmAccept(WorldPacket& recv_data); void HandleQuestgiverCompleteQuest(WorldPacket& recv_data); @@ -809,8 +809,8 @@ class MANGOS_DLL_SPEC WorldSession void HandleChatIgnoredOpcode(WorldPacket& recvPacket); uint32_t ChatCooldown(); - void HandleReclaimCorpseOpcode( WorldPacket& recvPacket ); - void HandleCorpseQueryOpcode( WorldPacket& recvPacket ); + void HandleReclaimCorpseOpcode(WorldPacket& recvPacket); + void HandleCorpseQueryOpcode(WorldPacket& recvPacket); void HandleResurrectResponseOpcode(WorldPacket& recvPacket); void HandleSummonResponseOpcode(WorldPacket& recv_data); @@ -837,36 +837,36 @@ class MANGOS_DLL_SPEC WorldSession void HandlePageQuerySkippedOpcode(WorldPacket& recvPacket); void HandlePageTextQueryOpcode(WorldPacket& recvPacket); - void HandleTutorialFlagOpcode ( WorldPacket & recv_data ); - void HandleTutorialClearOpcode( WorldPacket & recv_data ); - void HandleTutorialResetOpcode( WorldPacket & recv_data ); + void HandleTutorialFlagOpcode(WorldPacket & recv_data); + void HandleTutorialClearOpcode(WorldPacket & recv_data); + void HandleTutorialResetOpcode(WorldPacket & recv_data); //Pet - void HandlePetAction( WorldPacket & recv_data ); + void HandlePetAction(WorldPacket & recv_data); void HandlePetStopAttack(WorldPacket& recv_data); - void HandlePetNameQueryOpcode( WorldPacket & recv_data ); - void HandlePetSetAction( WorldPacket & recv_data ); - void HandlePetAbandon( WorldPacket & recv_data ); - void HandlePetRename( WorldPacket & recv_data ); - void HandlePetCancelAuraOpcode( WorldPacket& recvPacket ); - void HandlePetUnlearnOpcode( WorldPacket& recvPacket ); - void HandlePetSpellAutocastOpcode( WorldPacket& recvPacket ); - void HandlePetCastSpellOpcode( WorldPacket& recvPacket ); + void HandlePetNameQueryOpcode(WorldPacket & recv_data); + void HandlePetSetAction(WorldPacket & recv_data); + void HandlePetAbandon(WorldPacket & recv_data); + void HandlePetRename(WorldPacket & recv_data); + void HandlePetCancelAuraOpcode(WorldPacket& recvPacket); + void HandlePetUnlearnOpcode(WorldPacket& recvPacket); + void HandlePetSpellAutocastOpcode(WorldPacket& recvPacket); + void HandlePetCastSpellOpcode(WorldPacket& recvPacket); void HandleRequestPetInfoOpcode(WorldPacket& recv_data); void HandleCharRenameOpcode(WorldPacket& recv_data); static void HandleChangePlayerNameOpcodeCallBack(QueryResult *result, uint32 accountId, std::string newname); //BattleGround - void HandleBattlefieldJoinOpcode( WorldPacket &recv_data ); + void HandleBattlefieldJoinOpcode(WorldPacket &recv_data); void HandleBattlemasterHelloOpcode(WorldPacket &recv_data); void HandleBattlemasterJoinOpcode(WorldPacket &recv_data); void HandleBattleGroundPlayerPositionsOpcode(WorldPacket& recv_data); - void HandlePVPLogDataOpcode( WorldPacket &recv_data ); + void HandlePVPLogDataOpcode(WorldPacket &recv_data); void HandleBattlefieldStatusOpcode(WorldPacket &recv_data); - void HandleBattleFieldPortOpcode( WorldPacket &recv_data ); - void HandleBattlefieldListOpcode( WorldPacket &recv_data ); - void HandleLeaveBattlefieldOpcode( WorldPacket &recv_data ); + void HandleBattleFieldPortOpcode(WorldPacket &recv_data); + void HandleBattlefieldListOpcode(WorldPacket &recv_data); + void HandleLeaveBattlefieldOpcode(WorldPacket &recv_data); void HandleWardenDataOpcode(WorldPacket& recv_data); void HandleMinimapPingOpcode(WorldPacket& recv_data); @@ -889,11 +889,11 @@ class MANGOS_DLL_SPEC WorldSession bool VerifyMovementInfo(MovementInfo const& movementInfo) const; void HandleMoverRelocation(Unit* pMover, MovementInfo& movementInfo); - void ExecuteOpcode( OpcodeHandler const& opHandle, WorldPacket* packet ); + void ExecuteOpcode(OpcodeHandler const& opHandle, WorldPacket* packet); // logging helper - void LogUnexpectedOpcode(WorldPacket *packet, const char * reason); - void LogUnprocessedTail(WorldPacket *packet); + void LogUnexpectedOpcode(WorldPacket* packet, const char * reason); + void LogUnprocessedTail(WorldPacket* packet); Player *_player; ObjectGuid _clientMoverGuid; diff --git a/src/game/vmap/WorldModel.cpp b/src/game/vmap/WorldModel.cpp index f57b61c8d..bc54b4e6b 100644 --- a/src/game/vmap/WorldModel.cpp +++ b/src/game/vmap/WorldModel.cpp @@ -451,7 +451,7 @@ public: { float group_Z; // float pVol = prims[entry].GetBound().volume(); - // if(pVol < minVol) + // if (pVol < minVol) //{ /* if (prims[entry].iBound.contains(point)) */ if (prims[entry].IsInsideObject(point, zVec, group_Z))