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

This commit is contained in:
Shauren authored and Ovahlord committed 2022-11-18 10:38:58 +01:00
1 parent ed43e578f1
commit f5f6dbfa3e
2 files changed
+13 -1

No files matched your search

@@ -1549,7 +1549,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;
@@ -631,6 +631,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;
};