mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
refactor(Core/Object): adds consistency in the use of type object check (#19671)
This commit is contained in:
@@ -894,7 +894,7 @@ public:
|
||||
|
||||
void PassengerBoarded(Unit* pass, int8 /*seat*/, bool apply) override
|
||||
{
|
||||
if (pass && !apply && pass->GetTypeId() == TYPEID_PLAYER)
|
||||
if (pass && !apply && pass->IsPlayer())
|
||||
{
|
||||
Player* plr = pass->ToPlayer();
|
||||
float speed = plr->GetDistance(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()) / (1.0f * 0.001f);
|
||||
@@ -1258,7 +1258,7 @@ public:
|
||||
return;
|
||||
if (apply)
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
if (who->IsPlayer())
|
||||
{
|
||||
who->ApplySpellImmune(0, IMMUNITY_ID, SPELL_ARCANE_OVERLOAD_DMG, true);
|
||||
who->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SURGE_OF_POWER_DMG, true);
|
||||
@@ -1286,7 +1286,7 @@ public:
|
||||
me->SetCanFly(false);
|
||||
me->GetMotionMaster()->MoveLand(0, me->GetPositionX(), me->GetPositionY(), 267.24f, 10.0f);
|
||||
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
if (who->IsPlayer())
|
||||
{
|
||||
who->ApplySpellImmune(0, IMMUNITY_ID, SPELL_ARCANE_OVERLOAD_DMG, false);
|
||||
who->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SURGE_OF_POWER_DMG, false);
|
||||
@@ -1456,7 +1456,7 @@ public:
|
||||
me->SetDisableGravity(false);
|
||||
me->SendMovementFlagUpdate();
|
||||
}
|
||||
else if (pass && pass->GetTypeId() == TYPEID_PLAYER && me->IsAlive())
|
||||
else if (pass && pass->IsPlayer() && me->IsAlive())
|
||||
{
|
||||
me->SetDisplayId(11686); // prevents nasty falling animation at despawn
|
||||
me->DespawnOrUnsummon(1);
|
||||
|
||||
Reference in New Issue
Block a user