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

@@ -68,7 +68,7 @@ struct npc_brewfest_keg_thrower : public ScriptedAI
void MoveInLineOfSight(Unit* who) override
{
if (me->GetDistance(who) < 10.0f && who->GetTypeId() == TYPEID_PLAYER && who->GetMountID() == RAM_DISPLAY_ID)
if (me->GetDistance(who) < 10.0f && who->IsPlayer() && who->GetMountID() == RAM_DISPLAY_ID)
{
if (!who->ToPlayer()->HasItemCount(ITEM_PORTABLE_BREWFEST_KEG)) // portable brewfest keg
me->CastSpell(who, SPELL_THROW_KEG, true); // throw keg
@@ -90,7 +90,7 @@ struct npc_brewfest_keg_reciver : public ScriptedAI
void MoveInLineOfSight(Unit* who) override
{
if (me->GetDistance(who) < 10.0f && who->GetTypeId() == TYPEID_PLAYER && who->GetMountID() == RAM_DISPLAY_ID)
if (me->GetDistance(who) < 10.0f && who->IsPlayer() && who->GetMountID() == RAM_DISPLAY_ID)
{
Player* player = who->ToPlayer();
if (player->HasItemCount(ITEM_PORTABLE_BREWFEST_KEG)) // portable brewfest keg
@@ -149,7 +149,7 @@ struct npc_brewfest_bark_trigger : public ScriptedAI
void MoveInLineOfSight(Unit* who) override
{
if (me->GetDistance(who) < 10.0f && who->GetTypeId() == TYPEID_PLAYER && who->GetMountID() == RAM_DISPLAY_ID)
if (me->GetDistance(who) < 10.0f && who->IsPlayer() && who->GetMountID() == RAM_DISPLAY_ID)
{
bool allow = false;
uint32 quest = 0;