From 627be00a2dc8c790bc7d5f49a219904aed5603ed Mon Sep 17 00:00:00 2001 From: Kargatum Date: Fri, 22 Oct 2021 22:41:22 +0700 Subject: [PATCH] feat(DBC): correct dbcstructure interfacing (#48) https://github.com/TrinityCore/TrinityCore/commit/32600759b82aa8f8b8a9ef85772d05a717c83e7e --- src/Transmogrification.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Transmogrification.cpp b/src/Transmogrification.cpp index afad82c..3bd2efb 100644 --- a/src/Transmogrification.cpp +++ b/src/Transmogrification.cpp @@ -198,22 +198,20 @@ std::string Transmogrification::GetItemLink(Item* item, WorldSession* session) c if (int32 itemRandPropId = item->GetItemRandomPropertyId()) { - char* const* suffix = NULL; + std::array 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 += ' ';