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

@@ -201,7 +201,7 @@ class spell_rog_deadly_poison : public SpellScript
{
_stackAmount = 0;
// at this point CastItem must already be initialized
return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem();
return GetCaster()->IsPlayer() && GetCastItem();
}
void HandleBeforeHit(SpellMissInfo missInfo)
@@ -438,7 +438,7 @@ class spell_rog_preparation : public SpellScript
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
return GetCaster()->IsPlayer();
}
bool Validate(SpellInfo const* /*spellInfo*/) override
@@ -505,7 +505,7 @@ class spell_rog_prey_on_the_weak : public AuraScript
{
Unit* target = GetTarget();
Unit* victim = target->GetVictim();
if (!victim && target->GetTypeId() == TYPEID_PLAYER)
if (!victim && target->IsPlayer())
victim = target->ToPlayer()->GetSelectedUnit();
if (victim && (target->GetHealthPct() > victim->GetHealthPct()))
@@ -534,7 +534,7 @@ class spell_rog_rupture : public AuraScript
bool Load() override
{
Unit* caster = GetCaster();
return caster && caster->GetTypeId() == TYPEID_PLAYER;
return caster && caster->IsPlayer();
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
@@ -574,7 +574,7 @@ class spell_rog_shiv : public SpellScript
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
return GetCaster()->IsPlayer();
}
bool Validate(SpellInfo const* /*spellInfo*/) override