aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorModoX <moardox@gmail.com>2024-04-09 16:33:39 +0200
committerShauren <shauren.trinity@gmail.com>2024-10-05 17:55:14 +0200
commitd900e0e9558d310e7ca35a18dadac76310d47d77 (patch)
tree4cbc135f110fecce9a7ad180fceed4cd650b21e7 /src/server/game
parent6e6454860cac701ffa8a921677239b9b13e0e5de (diff)
Core/Entities: Added GetStringId helper methods
(cherry picked from commit 5cea37153eb6675bf0a25320a1c11cd0ec4969b6)
Diffstat (limited to 'src/server/game')
-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 789912326ec..5be6ec7b27f 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -201,6 +201,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 const& GetNameForLocaleIdx(LocaleConstant locale_idx) const override;
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index 882146faab9..af5261be1b1 100644
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -277,6 +277,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 GetUInt32Value(GAMEOBJECT_DISPLAYID); }