Core/Cleanup: move repeating code for locale strings retrieval into separate method. Related code cleanup.

--HG--
branch : trunk
This commit is contained in:
azazel
2010-08-27 00:57:49 +06:00
parent 4b5b4afbe9
commit e3c2bdb722
11 changed files with 85 additions and 194 deletions
+4 -8
View File
@@ -2948,8 +2948,7 @@ bool ChatHandler::HandleLookupItemCommand(const char *args)
if (loc_idx >= 0)
{
uint8 uloc_idx = uint8(loc_idx);
ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
if (il)
if (ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId))
{
if (il->Name.size() > uloc_idx && !il->Name[uloc_idx].empty())
{
@@ -3263,8 +3262,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args)
if (loc_idx >= 0)
{
uint8 uloc_idx = uint8(loc_idx);
QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId());
if (il)
if (QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId()))
{
if (il->Title.size() > uloc_idx && !il->Title[uloc_idx].empty())
{
@@ -3368,8 +3366,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
if (loc_idx >= 0)
{
uint8 uloc_idx = uint8(loc_idx);
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id);
if (cl)
if (CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id))
{
if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty ())
{
@@ -3439,8 +3436,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args)
if (loc_idx >= 0)
{
uint8 uloc_idx = uint8(loc_idx);
GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id);
if (gl)
if (GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id))
{
if (gl->Name.size() > uloc_idx && !gl->Name[uloc_idx].empty())
{