mirror of
https://github.com/azerothcore/mod-transmog
synced 2025-11-29 22:48:30 +08:00
fix: Support saving hidden items as part of transmog sets (#102)
This commit is contained in:
@@ -18,7 +18,7 @@ void Transmogrification::PresetTransmog(Player* player, Item* itemTransmogrified
|
||||
return;
|
||||
if (slot >= EQUIPMENT_SLOT_END)
|
||||
return;
|
||||
if (!CanTransmogrifyItemWithItem(player, itemTransmogrified->GetTemplate(), sObjectMgr->GetItemTemplate(fakeEntry)))
|
||||
if (fakeEntry != HIDDEN_ITEM_ID && (!CanTransmogrifyItemWithItem(player, itemTransmogrified->GetTemplate(), sObjectMgr->GetItemTemplate(fakeEntry))))
|
||||
return;
|
||||
|
||||
// [AZTH] Custom
|
||||
@@ -66,7 +66,7 @@ void Transmogrification::LoadPlayerSets(ObjectGuid pGUID)
|
||||
LOG_ERROR("module", "Item entry (FakeEntry: {}, player: {}, slot: {}, presetId: {}) has invalid slot, ignoring.", entry, pGUID.ToString(), slot, PresetID);
|
||||
continue;
|
||||
}
|
||||
if (sObjectMgr->GetItemTemplate(entry))
|
||||
if (entry == HIDDEN_ITEM_ID || sObjectMgr->GetItemTemplate(entry))
|
||||
presetById[pGUID][PresetID][slot] = entry; // Transmogrification::Preset(presetName, fakeEntry);
|
||||
}
|
||||
|
||||
@@ -238,6 +238,13 @@ std::string Transmogrification::GetItemLink(uint32 entry, WorldSession* session)
|
||||
{
|
||||
LOG_DEBUG("module", "Transmogrification::GetItemLink");
|
||||
|
||||
if (entry == HIDDEN_ITEM_ID)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "(Hidden)";
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
const ItemTemplate* temp = sObjectMgr->GetItemTemplate(entry);
|
||||
int loc_idx = session->GetSessionDbLocaleIndex();
|
||||
std::string name = temp->Name1;
|
||||
|
||||
@@ -316,12 +316,15 @@ public:
|
||||
uint32 entry = sT->GetFakeEntry(newItem->GetGUID());
|
||||
if (!entry)
|
||||
continue;
|
||||
const ItemTemplate* temp = sObjectMgr->GetItemTemplate(entry);
|
||||
if (!temp)
|
||||
continue;
|
||||
if (!sT->SuitableForTransmogrification(player, temp))
|
||||
continue;
|
||||
cost += sT->GetSpecialPrice(temp);
|
||||
if (entry != HIDDEN_ITEM_ID)
|
||||
{
|
||||
const ItemTemplate* temp = sObjectMgr->GetItemTemplate(entry);
|
||||
if (!temp)
|
||||
continue;
|
||||
if (!sT->SuitableForTransmogrification(player, temp))
|
||||
continue;
|
||||
cost += sT->GetSpecialPrice(temp);
|
||||
}
|
||||
items[slot] = entry;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user