mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[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:
parent
89612654da
commit
1da8ff0043
7 changed files with 42 additions and 2 deletions
|
|
@ -2028,3 +2028,19 @@ TrainerSpellData const* Creature::GetTrainerSpells() const
|
|||
{
|
||||
return objmgr.GetNpcTrainerSpells(GetEntry());
|
||||
}
|
||||
|
||||
// overwrite WorldObject function for proper name localization
|
||||
const char* Creature::GetNameForLocaleIdx(int32 loc_idx) const
|
||||
{
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
CreatureLocale const *cl = objmgr.GetCreatureLocale(GetEntry());
|
||||
if (cl)
|
||||
{
|
||||
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())
|
||||
return cl->Name[loc_idx].c_str();
|
||||
}
|
||||
}
|
||||
|
||||
return GetName();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue