diff options
author | Traesh <Traesh@users.noreply.github.com> | 2020-07-26 16:51:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-26 16:51:43 +0200 |
commit | 97afa3a609923bd9b7c0e9cfc52c29ba9dbfe35d (patch) | |
tree | 2f77482b54c2a913b1467a89507c8eedbe68db41 /src | |
parent | 588dce6bb0497e349fb6aac68c0a67a6560cb8a8 (diff) |
Core/Spells: Handle GAMEOBJECT_TYPE_UI_LINK spellFocus (#25132)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/GameObject/GameObjectData.h | 20 | ||||
-rw-r--r-- | src/server/game/Grids/Notifiers/GridNotifiers.h | 7 |
2 files changed, 22 insertions, 5 deletions
diff --git a/src/server/game/Entities/GameObject/GameObjectData.h b/src/server/game/Entities/GameObject/GameObjectData.h index 638661e0420..7477b9b5137 100644 --- a/src/server/game/Entities/GameObject/GameObjectData.h +++ b/src/server/game/Entities/GameObject/GameObjectData.h @@ -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; }; diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 23f3cf2ddc0..0b079eb610f 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -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); } |