refactor(Core/Object): adds consistency in the use of type object check (#19671)
This commit is contained in:
parent
61f3a631c3
commit
643362d697
189 changed files with 783 additions and 775 deletions
|
|
@ -355,7 +355,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
if (target->IsPlayer())
|
||||
{
|
||||
// check online security
|
||||
if (handler->HasLowerSecurity(target->ToPlayer()))
|
||||
|
|
@ -370,7 +370,7 @@ public:
|
|||
else if (target->IsPet())
|
||||
{
|
||||
Unit* owner = target->GetOwner();
|
||||
if (owner && owner->GetTypeId() == TYPEID_PLAYER && ((Pet*)target)->IsPermanentPetFor(owner->ToPlayer()))
|
||||
if (owner && owner->IsPlayer() && ((Pet*)target)->IsPermanentPetFor(owner->ToPlayer()))
|
||||
{
|
||||
// check online security
|
||||
if (handler->HasLowerSecurity(owner->ToPlayer()))
|
||||
|
|
@ -666,7 +666,7 @@ public:
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer()))
|
||||
if (target->IsPlayer() && handler->HasLowerSecurity(target->ToPlayer()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -843,7 +843,7 @@ public:
|
|||
{
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
}
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer())) // check online security
|
||||
else if (target->IsPlayer() && handler->HasLowerSecurity(target->ToPlayer())) // check online security
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -860,7 +860,7 @@ public:
|
|||
{
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
}
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer())) // check online security
|
||||
else if (target->IsPlayer() && handler->HasLowerSecurity(target->ToPlayer())) // check online security
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -873,7 +873,7 @@ public:
|
|||
{
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer())) // check online security
|
||||
if (target->IsPlayer() && handler->HasLowerSecurity(target->ToPlayer())) // check online security
|
||||
return false;
|
||||
|
||||
if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty())
|
||||
|
|
@ -892,7 +892,7 @@ public:
|
|||
{
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
}
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer())) // check online security
|
||||
else if (target->IsPlayer() && handler->HasLowerSecurity(target->ToPlayer())) // check online security
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue