Core/Spells: Handle GAMEOBJECT_TYPE_UI_LINK spellFocus

Port From (https://github.com/TrinityCore/TrinityCore/commit/97afa3a609923bd9b7c0e9cfc52c29ba9dbfe35d)
This commit is contained in:
hondacrx
2020-08-07 12:25:54 -04:00
parent 2467d0ca22
commit bc91e3492e
2 changed files with 28 additions and 5 deletions
@@ -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();
+2 -5
View File
@@ -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);
}