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

@@ -178,7 +178,7 @@ class spell_pal_divine_intervention : public AuraScript
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (!GetTarget()->IsInCombat() && GetTarget()->GetTypeId() == TYPEID_PLAYER)
if (!GetTarget()->IsInCombat() && GetTarget()->IsPlayer())
GetTarget()->RemoveAurasDueToSpell(GetTarget()->ToPlayer()->GetTeamId() == TEAM_ALLIANCE ? 57723 : 57724);
}
@@ -329,7 +329,7 @@ private:
{
healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
return GetUnitOwner()->IsPlayer();
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
@@ -518,7 +518,7 @@ class spell_pal_divine_sacrifice : public AuraScript
{
if (Unit* caster = GetCaster())
{
if (caster->GetTypeId() == TYPEID_PLAYER)
if (caster->IsPlayer())
{
if (caster->ToPlayer()->GetGroup())
groupSize = caster->ToPlayer()->GetGroup()->GetMembersCount();