mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Spells: Handle GAMEOBJECT_TYPE_UI_LINK spellFocus (#25132)
This commit is contained in:
@@ -926,6 +926,26 @@ struct GameObjectTemplate
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetSpellFocusType() const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GAMEOBJECT_TYPE_SPELL_FOCUS: return spellFocus.spellFocusType;
|
||||
case GAMEOBJECT_TYPE_UI_LINK: return UILink.spellFocusType;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetSpellFocusRadius() const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GAMEOBJECT_TYPE_SPELL_FOCUS: return spellFocus.radius;
|
||||
case GAMEOBJECT_TYPE_UI_LINK: return UILink.radius;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void InitializeQueryData();
|
||||
WorldPacket BuildQueryData(LocaleConstant loc) const;
|
||||
};
|
||||
|
||||
@@ -690,16 +690,13 @@ namespace Trinity
|
||||
|
||||
bool operator()(GameObject* go) const
|
||||
{
|
||||
if (go->GetGOInfo()->type != GAMEOBJECT_TYPE_SPELL_FOCUS)
|
||||
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.f;
|
||||
float dist = go->GetGOInfo()->GetSpellFocusRadius() / 2.f;
|
||||
|
||||
return go->IsWithinDistInMap(i_unit, dist);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user