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

@@ -190,7 +190,7 @@ public:
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER)
if (who->IsPlayer())
Talk(SAY_SLAY);
}

View File

@@ -161,7 +161,7 @@ public:
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER)
if (who->IsPlayer())
Talk(SAY_SLAY);
}

View File

@@ -154,7 +154,7 @@ public:
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER)
if (who->IsPlayer())
Talk(SAY_SLAY);
}

View File

@@ -280,7 +280,7 @@ public:
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER)
if (who->IsPlayer())
Talk(SAY_SLAY);
}

View File

@@ -115,7 +115,7 @@ public:
{
if (!target || !spell)
return;
if (spell->Id == SPELL_PURSUIT && target->GetTypeId() == TYPEID_PLAYER)
if (spell->Id == SPELL_PURSUIT && target->IsPlayer())
{
Talk(EMOTE_ICK_CHASE, target);
AttackStart(target);
@@ -262,7 +262,7 @@ public:
if (me->GetReactState() == REACT_PASSIVE)
me->SetReactState(REACT_AGGRESSIVE);
if (who->GetTypeId() == TYPEID_PLAYER)
if (who->IsPlayer())
if (Creature* k = GetKrick())
k->AI()->Talk(SAY_SLAY);
}

View File

@@ -209,7 +209,7 @@ public:
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER)
if (who->IsPlayer())
Talk(SAY_SLAY);
}

View File

@@ -881,7 +881,7 @@ public:
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (target && spell && target->GetTypeId() == TYPEID_PLAYER && spell->Id == 70827 && pInstance)
if (target && spell && target->IsPlayer() && spell->Id == 70827 && pInstance)
pInstance->SetData(DATA_ACHIEV_DONT_LOOK_UP, 0);
}
@@ -1185,7 +1185,7 @@ public:
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if ((spell->Id == SPELL_TELEPORT_JAINA || spell->Id == SPELL_TELEPORT_SYLVANAS) && target && target->GetTypeId() == TYPEID_PLAYER)
if ((spell->Id == SPELL_TELEPORT_JAINA || spell->Id == SPELL_TELEPORT_SYLVANAS) && target && target->IsPlayer())
{
float angle = rand_norm() * 2 * M_PI;
float dist = urand(1, 4);