Core/Misc: Update game object template locale in simple system

(cherry picked from commit f4536f3812)

Conflicts:
	src/server/game/Globals/ObjectMgr.cpp
	src/server/game/Handlers/QueryHandler.cpp
This commit is contained in:
Vincent-Michael
2015-07-19 01:24:45 +01:00
committed by DDuarte
parent f880f2e778
commit 9245bad755
3 changed files with 65 additions and 21 deletions

View File

@@ -174,15 +174,14 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recvData)
IconName = info->IconName;
CastBarCaption = info->castBarCaption;
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
if (GameObjectLocale const* gl = sObjectMgr->GetGameObjectLocale(entry))
LocaleConstant localeConstant = GetSessionDbLocaleIndex();
if (localeConstant >= LOCALE_enUS)
if (GameObjectLocale const* gameObjectLocale = sObjectMgr->GetGameObjectLocale(entry))
{
ObjectMgr::GetLocaleString(gl->Name, loc_idx, Name);
ObjectMgr::GetLocaleString(gl->CastBarCaption, loc_idx, CastBarCaption);
ObjectMgr::GetLocaleString(gameObjectLocale->Name, localeConstant, Name);
ObjectMgr::GetLocaleString(gameObjectLocale->CastBarCaption, localeConstant, CastBarCaption);
}
}
TC_LOG_DEBUG("network", "WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name.c_str(), entry);
WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 150);
data << uint32(entry);