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
@@ -674,14 +674,8 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
// local name
if (loc_idx >= 0)
{
ItemLocale const *il = sObjectMgr.GetItemLocale(proto->ItemId);
if (il)
{
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
name = il->Name[loc_idx];
}
}
if (ItemLocale const *il = sObjectMgr.GetItemLocale(proto->ItemId))
sObjectMgr.GetLocaleString(il->Name, loc_idx, name);
// DO NOT use GetItemEnchantMod(proto->RandomProperty) as it may return a result
// that matches the search but it may not equal item->GetItemRandomPropertyId()