aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities
diff options
context:
space:
mode:
authorModoX <moardox@gmail.com>2024-04-09 16:33:39 +0200
committerModoX <moardox@gmail.com>2024-04-09 16:34:24 +0200
commit5cea37153eb6675bf0a25320a1c11cd0ec4969b6 (patch)
tree63c383e1c23f78c66e4f7ea5e92f1c089151c2d3 /src/server/game/Entities
parent9ac03bf2b84f15f70bf37481cf563dcfe3cac626 (diff)
Core/Entities: Added GetStringId helper methods
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 839abfdd725..dfe58043b43 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -258,6 +258,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; }