aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/PetHandler.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-06-19 23:20:06 -0300
committerariel- <ariel-@users.noreply.github.com>2017-06-19 23:20:06 -0300
commit85a7d5ce9ac68b30da2277cc91d4b70358f1880d (patch)
treedf3d2084ee2e35008903c03178039b9c986e2d08 /src/server/game/Handlers/PetHandler.cpp
parent052fc24315ace866ea1cf610e85df119b68100c9 (diff)
Core: ported headers cleanup from master branch
Diffstat (limited to 'src/server/game/Handlers/PetHandler.cpp')
-rw-r--r--src/server/game/Handlers/PetHandler.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index 53dc69ffd94..296e444f939 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -16,24 +16,26 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Common.h"
-#include "WorldPacket.h"
#include "WorldSession.h"
-#include "ObjectMgr.h"
-#include "SpellMgr.h"
+#include "Common.h"
+#include "CreatureAI.h"
+#include "DatabaseEnv.h"
+#include "Group.h"
#include "Log.h"
-#include "Opcodes.h"
-#include "Spell.h"
+#include "MotionMaster.h"
#include "ObjectAccessor.h"
-#include "CreatureAI.h"
-#include "PetAI.h"
-#include "Util.h"
+#include "ObjectMgr.h"
+#include "Opcodes.h"
#include "Pet.h"
-#include "World.h"
-#include "Group.h"
+#include "PetAI.h"
+#include "Player.h"
+#include "Spell.h"
#include "SpellHistory.h"
#include "SpellInfo.h"
-#include "Player.h"
+#include "SpellMgr.h"
+#include "Util.h"
+#include "World.h"
+#include "WorldPacket.h"
void WorldSession::HandleDismissCritter(WorldPacket& recvData)
{
@@ -88,7 +90,7 @@ void WorldSession::HandlePetAction(WorldPacket& recvData)
if (!pet->IsAlive())
{
- SpellInfo const* spell = (flag == ACT_ENABLED || flag == ACT_PASSIVE) ? sSpellMgr->GetSpellInfo(spellid) : NULL;
+ SpellInfo const* spell = (flag == ACT_ENABLED || flag == ACT_PASSIVE) ? sSpellMgr->GetSpellInfo(spellid) : nullptr;
if (!spell)
return;
if (!spell->HasAttribute(SPELL_ATTR0_CASTABLE_WHILE_DEAD))
@@ -288,7 +290,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
case ACT_PASSIVE: // 0x01
case ACT_ENABLED: // 0xC1 spell
{
- Unit* unit_target = NULL;
+ Unit* unit_target = nullptr;
if (guid2)
unit_target = ObjectAccessor::GetUnit(*_player, guid2);
@@ -429,7 +431,7 @@ void WorldSession::SendPetNameQuery(ObjectGuid petguid, uint32 petnumber)
data << uint8(0);
data << uint32(0);
data << uint8(0);
- _player->GetSession()->SendPacket(&data);
+ _player->SendDirectMessage(&data);
return;
}
@@ -447,7 +449,7 @@ void WorldSession::SendPetNameQuery(ObjectGuid petguid, uint32 petnumber)
else
data << uint8(0);
- _player->GetSession()->SendPacket(&data);
+ _player->SendDirectMessage(&data);
}
bool WorldSession::CheckStableMaster(ObjectGuid guid)
@@ -614,13 +616,13 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
PetNameInvalidReason res = ObjectMgr::CheckPetName(name, GetSessionDbcLocale());
if (res != PET_NAME_SUCCESS)
{
- SendPetNameInvalid(res, name, NULL);
+ SendPetNameInvalid(res, name, nullptr);
return;
}
if (sObjectMgr->IsReservedName(name))
{
- SendPetNameInvalid(PET_NAME_RESERVED, name, NULL);
+ SendPetNameInvalid(PET_NAME_RESERVED, name, nullptr);
return;
}
@@ -673,7 +675,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
CharacterDatabase.CommitTransaction(trans);
- pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped
+ pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(nullptr))); // cast can't be helped
}
void WorldSession::HandlePetAbandon(WorldPacket& recvData)
@@ -713,7 +715,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
if (guid.IsPlayer())
return;
- Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
+ Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
if (!pet || (pet != _player->GetGuardianPet() && pet != _player->GetCharm()))
{
@@ -793,7 +795,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
spell->m_cast_count = castCount; // probably pending spell cast
spell->m_targets = targets;
- SpellCastResult result = spell->CheckPetCast(NULL);
+ SpellCastResult result = spell->CheckPetCast(nullptr);
if (result == SPELL_CAST_OK)
{