Skip to content

Commit

Permalink
Once more get the localized name of items in AH searches (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
bladezLH committed Oct 31, 2018
1 parent 3d7cccc commit a63adb7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/game/AuctionHouse/AuctionHouseMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
if (propertyId > 0)
randomProperty = sItemRandomPropertiesStore.LookupEntry(static_cast<uint32>(propertyId));

if (randomProperty)
Item::GetNameWithSuffix(name, proto, randomProperty, loc_idx, dbc_loc);
Item::GetLocalizedNameWithSuffix(name, proto, randomProperty, loc_idx, dbc_loc);

if (!Utf8FitTo(name, query.wsearchedname))
continue;
Expand Down
4 changes: 2 additions & 2 deletions src/game/Chat/Chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2134,7 +2134,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
// Compare the name. If the name isn't correct, maybe it's an enchantment
// instead.
std::string expectedName = linkedItem->Name1;
Item::GetNameWithSuffix(expectedName, linkedItem, iProp, dbLocale, dbcLocale);
Item::GetLocalizedNameWithSuffix(expectedName, linkedItem, iProp, dbLocale, dbcLocale);
if (expectedName == buffer)
{
hasValidRandomProperty = true;
Expand Down Expand Up @@ -2162,7 +2162,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
{
// Finally compare base name
std::string expectedName = linkedItem->Name1;
Item::GetNameWithSuffix(expectedName, linkedItem, nullptr, dbLocale, dbcLocale);
Item::GetLocalizedNameWithSuffix(expectedName, linkedItem, nullptr, dbLocale, dbcLocale);
if (expectedName != buffer)
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/Objects/Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ bool Item::ChangeEntry(ItemPrototype const* pNewProto)
return true;
}

void Item::GetNameWithSuffix(std::string& name, const ItemPrototype* proto, const ItemRandomPropertiesEntry* randomProp, int dbLocale, LocaleConstant dbcLocale)
void Item::GetLocalizedNameWithSuffix(std::string& name, const ItemPrototype* proto, const ItemRandomPropertiesEntry* randomProp, int dbLocale, LocaleConstant dbcLocale)
{
// local name
if (dbLocale >= 0)
Expand Down
2 changes: 1 addition & 1 deletion src/game/Objects/Item.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ class MANGOS_DLL_SPEC Item : public Object
bool HasGeneratedLootSecondary() { return generatedLoot; } // todo, remove and add condition to HasGeneratedLoot

bool IsCharter() const { return GetEntry() == 5863u; }
static void GetNameWithSuffix(std::string& name, const ItemPrototype* proto, const ItemRandomPropertiesEntry* randomProp, int dbLocale, LocaleConstant dbcLocale);
static void GetLocalizedNameWithSuffix(std::string& name, const ItemPrototype* proto, const ItemRandomPropertiesEntry* randomProp, int dbLocale, LocaleConstant dbcLocale);

private:
bool generatedLoot;
Expand Down

0 comments on commit a63adb7

Please sign in to comment.