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

Port From (https://github.com/TrinityCore/TrinityCore/commit/7df4f5b2856af9b8eb2af83f827915ac28e3db3a)
This commit is contained in:
hondacrx
2023-01-22 23:34:45 -05:00
parent 357d9a4294
commit 1b04ea97e8
2 changed files with 10 additions and 1 deletions
@@ -1295,7 +1295,7 @@ namespace Game.Entities
if (base.IsNeverVisibleFor(seer))
return true;
if (GetGoType() == GameObjectTypes.SpellFocus && GetGoInfo().SpellFocus.serverOnly == 1)
if (GetGoInfo().GetServerOnly() != 0)
return true;
if (GetDisplayId() == 0)
@@ -677,6 +677,15 @@ namespace Game.Entities
}
}
public uint GetServerOnly() => type switch
{
GameObjectTypes.Generic => Generic.serverOnly,
GameObjectTypes.Trap => Trap.serverOnly,
GameObjectTypes.SpellFocus => SpellFocus.serverOnly,
GameObjectTypes.AuraGenerator => AuraGenerator.serverOnly,
_ => 0,
};
public uint GetSpellFocusType()
{
switch (type)