From bfa9e7516177af9e13391a09d4e1356c74a4c2ba Mon Sep 17 00:00:00 2001 From: visagalis Date: Fri, 14 Nov 2008 17:03:03 -0600 Subject: [svn] *** Source: MaNGOS *** * Implement localization of creature/gameobject name that say/yell. Author: evilstar (rewrited by: Vladimir) * Fix auth login queue. Author: Derex * Allowed switching INVTYPE_HOLDABLE items during combat, used correct spells for triggering global cooldown at weapon switch. Author: mobel/simak * Fixed some format arg type/value pairs. Other warnings. Author: Vladimir * [238_world.sql] Allow have team dependent graveyards at entrance map for instances. Author: Vladimir NOTE: Entrance map graveyards selected by same way as local (by distance from entrance) Until DB support will work in old way base at current DB data. --HG-- branch : trunk --- src/game/Creature.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/game/Creature.cpp') diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 9f3422dbc28..5e3d3ac9f8e 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -2182,3 +2182,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(); +} -- cgit v1.2.3