mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 17:43:47 +00:00
refactor(Core/Object): adds consistency in the use of type object check (#19671)
This commit is contained in:
@@ -92,7 +92,7 @@ void WorldSession::HandlePetAction(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
// Xinef: allow to controll players
|
||||
if (pet->GetTypeId() == TYPEID_PLAYER && flag != ACT_COMMAND && flag != ACT_REACTION)
|
||||
if (pet->IsPlayer() && flag != ACT_COMMAND && flag != ACT_REACTION)
|
||||
return;
|
||||
|
||||
// Do not follow itself vehicle
|
||||
@@ -387,17 +387,17 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
|
||||
if (unit_target)
|
||||
{
|
||||
pet->SetInFront(unit_target);
|
||||
if (unit_target->GetTypeId() == TYPEID_PLAYER)
|
||||
if (unit_target->IsPlayer())
|
||||
pet->SendUpdateToPlayer(unit_target->ToPlayer());
|
||||
}
|
||||
else if (Unit* unit_target2 = spell->m_targets.GetUnitTarget())
|
||||
{
|
||||
pet->SetInFront(unit_target2);
|
||||
if (unit_target2->GetTypeId() == TYPEID_PLAYER)
|
||||
if (unit_target2->IsPlayer())
|
||||
pet->SendUpdateToPlayer(unit_target2->ToPlayer());
|
||||
}
|
||||
if (Unit* powner = pet->GetCharmerOrOwner())
|
||||
if (powner->GetTypeId() == TYPEID_PLAYER)
|
||||
if (powner->IsPlayer())
|
||||
pet->SendUpdateToPlayer(powner->ToPlayer());
|
||||
|
||||
result = SPELL_CAST_OK;
|
||||
@@ -853,7 +853,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
|
||||
pet->SetName(name);
|
||||
|
||||
Unit* owner = pet->GetOwner();
|
||||
if (owner && (owner->GetTypeId() == TYPEID_PLAYER) && owner->ToPlayer()->GetGroup())
|
||||
if (owner && (owner->IsPlayer()) && owner->ToPlayer()->GetGroup())
|
||||
owner->ToPlayer()->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_NAME);
|
||||
|
||||
pet->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED);
|
||||
@@ -1065,7 +1065,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
|
||||
if (!caster->GetCharmInfo() || !caster->GetCharmInfo()->GetForcedSpell())
|
||||
spell->SendPetCastResult(result);
|
||||
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (caster->IsPlayer())
|
||||
{
|
||||
if (!caster->ToPlayer()->HasSpellCooldown(spellId))
|
||||
GetPlayer()->SendClearCooldown(spellId, caster);
|
||||
|
||||
Reference in New Issue
Block a user