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

@@ -114,7 +114,7 @@ struct emerald_dragonAI : public WorldBossAI
// Target killed during encounter, mark them as suspectible for Aura Of Nature
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER)
if (who->IsPlayer())
who->CastSpell(who, SPELL_MARK_OF_NATURE, true);
}
@@ -431,7 +431,7 @@ public:
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (spell->Id == SPELL_DRAW_SPIRIT && target->GetTypeId() == TYPEID_PLAYER)
if (spell->Id == SPELL_DRAW_SPIRIT && target->IsPlayer())
{
Position targetPos = target->GetPosition();
me->SummonCreature(NPC_SPIRIT_SHADE, targetPos, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000);
@@ -531,7 +531,7 @@ public:
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER)
if (who->IsPlayer())
{
who->CastSpell(who, SPELL_PUTRID_MUSHROOM, true);
}

View File

@@ -81,7 +81,7 @@ public:
else if (banishTimer <= diff)
{
Unit* temp = me->GetVictim();
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
if (temp && temp->IsPlayer())
{
DoCast(temp, SPELL_BANISHED_SHATTRATH_A);
banishTimer = 9000;
@@ -148,7 +148,7 @@ public:
else if (banishTimer <= diff)
{
Unit* temp = me->GetVictim();
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
if (temp && temp->IsPlayer())
{
DoCast(temp, SPELL_BANISHED_SHATTRATH_S);
banishTimer = 9000;

View File

@@ -55,7 +55,7 @@ void NPCStaveQuestAI::StorePlayerGUID()
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
{
if ((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER)
if ((*itr)->getTarget()->IsPlayer())
{
playerGUID = (*itr)->getUnitGuid();
}