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

@@ -437,7 +437,7 @@ struct npc_midsummer_torch_target : public ScriptedAI
if (posVec.empty())
return;
// Triggered spell from torch
if (spellInfo->Id == SPELL_TORCH_TOSS_LAND && caster->GetTypeId() == TYPEID_PLAYER)
if (spellInfo->Id == SPELL_TORCH_TOSS_LAND && caster->IsPlayer())
{
me->CastSpell(me, SPELL_BRAZIERS_HIT_VISUAL, true); // hit visual anim
if (++counter >= maxCount)
@@ -906,12 +906,12 @@ class spell_midsummer_ribbon_pole : public AuraScript
target->CastSpell(target, SPELL_RIBBON_POLE_XP, true);
// Achievement
if ((GameTime::GetGameTime().count() - GetApplyTime()) > 60 && target->GetTypeId() == TYPEID_PLAYER)
if ((GameTime::GetGameTime().count() - GetApplyTime()) > 60 && target->IsPlayer())
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58934, 0, target);
}
// Achievement
if ((time(nullptr) - GetApplyTime()) > 60 && target->GetTypeId() == TYPEID_PLAYER)
if ((time(nullptr) - GetApplyTime()) > 60 && target->IsPlayer())
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58934, 0, target);
}
}