Core/GameObjects: Use serverOnly property of GameObjectTemplate for all types that have it, not just spell focus

This commit is contained in:
Shauren
2022-11-15 11:57:19 +01:00
parent 37d8b6d33b
commit 4ee64a232a
2 changed files with 13 additions and 1 deletions

View File

@@ -1245,7 +1245,7 @@ bool GameObject::IsNeverVisible() const
if (WorldObject::IsNeverVisible())
return true;
if (GetGoType() == GAMEOBJECT_TYPE_SPELL_FOCUS && GetGOInfo()->spellFocus.serverOnly == 1)
if (GetGOInfo()->GetServerOnly())
return true;
return false;

View File

@@ -617,6 +617,18 @@ struct GameObjectTemplate
}
}
uint32 GetServerOnly() const
{
switch (type)
{
case GAMEOBJECT_TYPE_GENERIC: return _generic.serverOnly;
case GAMEOBJECT_TYPE_TRAP: return trap.serverOnly;
case GAMEOBJECT_TYPE_SPELL_FOCUS: return spellFocus.serverOnly;
case GAMEOBJECT_TYPE_AURA_GENERATOR: return auraGenerator.serverOnly;
default: return 0;
}
}
void InitializeQueryData();
WorldPacket BuildQueryData(LocaleConstant loc) const;
};