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

@@ -510,7 +510,7 @@ void GameObject::Update(uint32 diff)
{
// splash bobber (bobber ready now)
Unit* caster = GetOwner();
if (caster && caster->GetTypeId() == TYPEID_PLAYER)
if (caster && caster->IsPlayer())
{
SetGoState(GO_STATE_ACTIVE);
ReplaceAllGameObjectFlags(GO_FLAG_NODESPAWN);
@@ -634,7 +634,7 @@ void GameObject::Update(uint32 diff)
case GAMEOBJECT_TYPE_FISHINGNODE: // can't fish now
{
Unit* caster = GetOwner();
if (caster && caster->GetTypeId() == TYPEID_PLAYER)
if (caster && caster->IsPlayer())
{
caster->ToPlayer()->RemoveGameObject(this, false);
@@ -1635,7 +1635,7 @@ void GameObject::Use(Unit* user)
if (HasGameObjectFlag(GO_FLAG_IN_USE))
return;
if (user->GetTypeId() == TYPEID_PLAYER)
if (user->IsPlayer())
{
Player* player = user->ToPlayer();