mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 10:55:43 +00:00
refactor(Core/Object): adds consistency in the use of type object check (#19671)
This commit is contained in:
@@ -5904,7 +5904,7 @@ float Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr
|
||||
// Calculates how many reputation points player gains in victim's enemy factions
|
||||
void Player::RewardReputation(Unit* victim)
|
||||
{
|
||||
if (!victim || victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!victim || victim->IsPlayer())
|
||||
return;
|
||||
|
||||
if (victim->ToCreature()->IsReputationGainDisabled())
|
||||
@@ -6036,7 +6036,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
return false;
|
||||
|
||||
/* check if player has same IP
|
||||
if (uVictim && uVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (uVictim && uVictim->IsPlayer())
|
||||
{
|
||||
if (GetSession()->GetRemoteAddress() == uVictim->ToPlayer()->GetSession()->GetRemoteAddress())
|
||||
return false;
|
||||
@@ -6063,7 +6063,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
|
||||
victim_guid = uVictim->GetGUID();
|
||||
|
||||
if (uVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (uVictim->IsPlayer())
|
||||
{
|
||||
Player* victim = uVictim->ToPlayer();
|
||||
|
||||
@@ -6174,7 +6174,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
if (!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT))
|
||||
return true;
|
||||
|
||||
if (uVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (uVictim->IsPlayer())
|
||||
{
|
||||
// Check if allowed to receive it in current map
|
||||
uint8 MapType = sWorld->getIntConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
|
||||
@@ -9161,7 +9161,7 @@ Pet* Player::CreatePet(Creature* creatureTarget, uint32 spellID /*= 0*/)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!creatureTarget || creatureTarget->IsPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!creatureTarget || creatureTarget->IsPet() || creatureTarget->IsPlayer())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user