[6812] Implement localization of creature/gameobject name that say/yell.

Original patch deeply rewrited.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
evilstar 2008-11-09 13:12:16 +03:00 committed by VladimirMangos
parent 89612654da
commit 1da8ff0043
7 changed files with 42 additions and 2 deletions

View file

@ -1245,3 +1245,19 @@ void GameObject::Use(Unit* user)
spell->prepare(&targets);
}
// 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();
}