mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-15 00:06:11 +00:00
refactor(Core/Object): adds consistency in the use of type object check (#19671)
This commit is contained in:
@@ -116,7 +116,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||
if( who->IsPlayer() )
|
||||
{
|
||||
Talk(SAY_EADRIC_KILL_PLAYER);
|
||||
}
|
||||
@@ -243,7 +243,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||
if( who->IsPlayer() )
|
||||
{
|
||||
Talk(SAY_PALETRESS_KILL_PLAYER);
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if( victim->GetTypeId() == TYPEID_PLAYER )
|
||||
if( victim->IsPlayer() )
|
||||
{
|
||||
Talk(SAY_BK_KILL_PLAYER);
|
||||
}
|
||||
@@ -434,7 +434,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case SPELL_EXPLODE_H:
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
if (target && target->IsPlayer())
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ACHIEV_IVE_HAD_WORSE, 0);
|
||||
break;
|
||||
|
||||
@@ -385,7 +385,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||
if( who->IsPlayer() )
|
||||
Talk(SAY_KILL_PLAYER);
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ struct boss_faction_championsAI : 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);
|
||||
|
||||
@@ -161,12 +161,12 @@ public:
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_SPELL_SNOBOLLED:
|
||||
if( t->GetTypeId() == TYPEID_PLAYER )
|
||||
if( t->IsPlayer() )
|
||||
me->CastSpell((Unit*)nullptr, SPELL_SNOBOLLED, true);
|
||||
|
||||
break;
|
||||
case EVENT_SPELL_BATTER:
|
||||
if( t->GetTypeId() == TYPEID_PLAYER )
|
||||
if( t->IsPlayer() )
|
||||
me->CastSpell(t, SPELL_BATTER);
|
||||
events.Repeat(6s, 8s);
|
||||
break;
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case EVENT_SPELL_HEAD_CRACK:
|
||||
if( t->GetTypeId() == TYPEID_PLAYER )
|
||||
if( t->IsPlayer() )
|
||||
me->CastSpell(t, SPELL_HEAD_CRACK);
|
||||
events.Repeat(30s, 35s);
|
||||
break;
|
||||
|
||||
@@ -499,7 +499,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||
if( who->IsPlayer() )
|
||||
{
|
||||
Talk(SAY_KILL_PLAYER);
|
||||
if( Creature* twin = GetSister() )
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
|
||||
void OnUnitDeath(Unit* u) override
|
||||
{
|
||||
if (bNooneDied && u->GetTypeId() == TYPEID_PLAYER)
|
||||
if (bNooneDied && u->IsPlayer())
|
||||
{
|
||||
bNooneDied = false;
|
||||
SaveToDB();
|
||||
|
||||
Reference in New Issue
Block a user