aboutsummaryrefslogtreecommitdiff
path: root/src/game/GameObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/GameObject.cpp')
-rw-r--r--src/game/GameObject.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index f725e8063c8..75a1f9be985 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -1285,3 +1285,19 @@ void GameObject::CastSpell(Unit* target, uint32 spell)
//trigger->setDeathState(JUST_DIED);
//trigger->RemoveCorpse();
}
+
+// overwrite WorldObject function for proper name localization
+const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
+{
+ if (loc_idx >= 0)
+ {
+ GameObjectLocale const *cl = objmgr.GetGameObjectLocale(GetEntry());
+ if (cl)
+ {
+ if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())
+ return cl->Name[loc_idx].c_str();
+ }
+ }
+
+ return GetName();
+}