diff --git a/Source/Game/Entities/GameObject/GameObjectData.cs b/Source/Game/Entities/GameObject/GameObjectData.cs index d988c14c8..41d3bb380 100644 --- a/Source/Game/Entities/GameObject/GameObjectData.cs +++ b/Source/Game/Entities/GameObject/GameObjectData.cs @@ -517,6 +517,32 @@ namespace Game.Entities } } + public uint GetSpellFocusType() + { + switch (type) + { + case GameObjectTypes.SpellFocus: + return SpellFocus.spellFocusType; + case GameObjectTypes.UILink: + return UILink.spellFocusType; + default: + return 0; + } + } + + public uint GetSpellFocusRadius() + { + switch (type) + { + case GameObjectTypes.SpellFocus: + return SpellFocus.radius; + case GameObjectTypes.UILink: + return UILink.radius; + default: + return 0; + } + } + public void InitializeQueryData() { QueryData = new QueryGameObjectResponse(); diff --git a/Source/Game/Maps/GridNotifiers.cs b/Source/Game/Maps/GridNotifiers.cs index a4f7358f8..a46b57789 100644 --- a/Source/Game/Maps/GridNotifiers.cs +++ b/Source/Game/Maps/GridNotifiers.cs @@ -2247,16 +2247,13 @@ namespace Game.Maps public bool Invoke(GameObject go) { - if (go.GetGoInfo().type != GameObjectTypes.SpellFocus) - return false; - - if (go.GetGoInfo().SpellFocus.spellFocusType != i_focusId) + if (go.GetGoInfo().GetSpellFocusType() != i_focusId) return false; if (!go.IsSpawned()) return false; - float dist = go.GetGoInfo().SpellFocus.radius / 2.0f; + float dist = go.GetGoInfo().GetSpellFocusRadius() / 2.0f; return go.IsWithinDistInMap(i_unit, dist); }