aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities
diff options
context:
space:
mode:
authorModoX <moardox@gmail.com>2024-04-09 16:33:39 +0200
committerOvahlord <dreadkiller@gmx.de>2024-05-28 16:40:19 +0200
commit3db82077c9a7565e82089b2d6436031c2eceb17b (patch)
tree7105c9fae7ff127270d888b23c5121e215799466 /src/server/game/Entities
parent33ab88ac96c49ae02961158d82e4a55774101ccb (diff)
Core/Entities: Added GetStringId helper methods
(cherry picked from commit 5cea37153eb6675bf0a25320a1c11cd0ec4969b6)
Diffstat (limited to 'src/server/game/Entities')
-rw-r--r--src/server/game/Entities/Creature/Creature.h1
-rw-r--r--src/server/game/Entities/GameObject/GameObject.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index a64ba0c02e7..848b6ae7f2e 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -247,6 +247,7 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
bool HasStringId(std::string_view id) const;
void SetScriptStringId(std::string id);
std::array<std::string_view, 3> const& GetStringIds() const { return m_stringIds; }
+ std::string_view const& GetStringId(StringIdType type) const { return m_stringIds[AsUnderlyingType(type)]; }
// override WorldObject function for proper name localization
std::string GetNameForLocaleIdx(LocaleConstant locale) const override;
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index 0f8941dc870..7cc72dd92c9 100644
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -381,6 +381,7 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>
bool HasStringId(std::string_view id) const;
void SetScriptStringId(std::string id);
std::array<std::string_view, 3> const& GetStringIds() const { return m_stringIds; }
+ std::string_view const& GetStringId(StringIdType type) const { return m_stringIds[AsUnderlyingType(type)]; }
void SetDisplayId(uint32 displayid);
uint32 GetDisplayId() const { return m_gameObjectData->DisplayID; }