refactor(Core/Object): adds consistency in the use of type object check (#19671)

This commit is contained in:
Grimdhex
2024-08-25 14:57:37 +02:00
committed by GitHub
parent 61f3a631c3
commit 643362d697
189 changed files with 783 additions and 775 deletions

View File

@@ -351,7 +351,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
// ignore for remote control state (for player case)
Unit* mover = _player->m_mover;
if (mover != _player && mover->GetTypeId() == TYPEID_PLAYER)
if (mover != _player && mover->IsPlayer())
{
recvPacket.rfinish(); // prevent spam at ignore packet
return;
@@ -372,7 +372,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
HandleClientCastFlags(recvPacket, castFlags, targets);
// not have spell in spellbook
if (mover->GetTypeId() == TYPEID_PLAYER)
if (mover->IsPlayer())
{
// not have spell in spellbook or spell passive and not casted by client
if( !(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!mover->ToPlayer()->HasActiveSpell(spellId) || spellInfo->IsPassive()) )
@@ -688,7 +688,7 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData)
data << uint8(creator->getGender());
data << uint8(creator->getClass());
if (creator->GetTypeId() == TYPEID_PLAYER)
if (creator->IsPlayer())
{
Player* player = creator->ToPlayer();
data << uint8(player->GetByteValue(PLAYER_BYTES, 0)); // skin