feat(DBC): correct dbcstructure interfacing (#48)

32600759b8
This commit is contained in:
Kargatum
2021-10-22 22:41:22 +07:00
committed by GitHub
parent eb62c1e0f2
commit 627be00a2d

View File

@@ -198,22 +198,20 @@ std::string Transmogrification::GetItemLink(Item* item, WorldSession* session) c
if (int32 itemRandPropId = item->GetItemRandomPropertyId())
{
char* const* suffix = NULL;
std::array<char const*, 16> const* suffix = nullptr;
if (itemRandPropId < 0)
{
const ItemRandomSuffixEntry* itemRandEntry = sItemRandomSuffixStore.LookupEntry(-item->GetItemRandomPropertyId());
if (itemRandEntry)
suffix = itemRandEntry->nameSuffix;
if (const ItemRandomSuffixEntry* itemRandEntry = sItemRandomSuffixStore.LookupEntry(-itemRandPropId))
suffix = &itemRandEntry->Name;
}
else
{
const ItemRandomPropertiesEntry* itemRandEntry = sItemRandomPropertiesStore.LookupEntry(item->GetItemRandomPropertyId());
if (itemRandEntry)
suffix = itemRandEntry->nameSuffix;
if (const ItemRandomPropertiesEntry* itemRandEntry = sItemRandomPropertiesStore.LookupEntry(itemRandPropId))
suffix = &itemRandEntry->Name;
}
if (suffix)
{
std::string test(suffix[(name != temp->Name1) ? loc_idx : DEFAULT_LOCALE]);
std::string_view test((*suffix)[(name != temp->Name1) ? loc_idx : DEFAULT_LOCALE]);
if (!test.empty())
{
name += ' ';