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

@@ -142,7 +142,7 @@ struct boss_felblood_kaelthas : public ScriptedAI
void MoveInLineOfSight(Unit* who) override
{
if (!introSpeak && me->IsWithinDistInMap(who, 40.0f) && who->GetTypeId() == TYPEID_PLAYER)
if (!introSpeak && me->IsWithinDistInMap(who, 40.0f) && who->IsPlayer())
{
Talk(SAY_AGGRO);
introSpeak = true;

View File

@@ -292,7 +292,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
for (ThreatContainer::StorageType::const_iterator itr = tList.begin(); itr != tList.end(); ++itr)
{
Unit* pUnit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER && me->GetThreatMgr().GetThreat(pUnit))
if (pUnit && pUnit->IsPlayer() && me->GetThreatMgr().GetThreat(pUnit))
{
float threatMod = GetThreatMod(me->GetDistance2d(pUnit), (float)pUnit->GetArmor(), pUnit->GetHealth(), pUnit->GetMaxHealth(), pUnit);
me->GetThreatMgr().ModifyThreatByPercent(pUnit, -100);

View File

@@ -116,7 +116,7 @@ struct boss_selin_fireheart : public ScriptedAI
void KilledUnit(Unit* victim) override
{
if (victim->GetTypeId() == TYPEID_PLAYER)
if (victim->IsPlayer())
Talk(SAY_KILL);
}

View File

@@ -82,7 +82,7 @@ struct boss_vexallus : public BossAI
void KilledUnit(Unit* victim) override
{
if (victim->GetTypeId() == TYPEID_PLAYER)
if (victim->IsPlayer())
Talk(SAY_KILL);
}