Core/Item: Localization items. (#223)

This commit is contained in:
HeartWell
2016-11-04 23:03:48 +03:00
committed by Shin
parent b9aa88ac2b
commit 8088ca220a
6 changed files with 38359 additions and 19 deletions

View File

@@ -522,6 +522,9 @@ bool AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
time_t curTime = sWorld->GetGameTime();
int loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
int locdbc_idx = player->GetSession()->GetSessionDbcLocale();
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
{
if (AsyncAuctionListingMgr::IsAuctionListingAllowed() == false) // pussywizard: World::Update is waiting for us...
@@ -577,6 +580,11 @@ bool AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
if (name.empty())
continue;
// local name
if (loc_idx >= 0)
if (ItemLocale const* il = sObjectMgr->GetItemLocale(proto->ItemId))
ObjectMgr::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()
// used in BuildAuctionInfo() which then causes wrong items to be listed
@@ -609,7 +617,7 @@ bool AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
// Append the suffix (ie: of the Monkey) to the name using localization
// or default enUS if localization is invalid
name += ' ';
name += suffix[LOCALE_enUS];
name += suffix[locdbc_idx >= 0 ? locdbc_idx : LOCALE_enUS];
}
}