Core/Misc: fixed several item loading functions which had their field indexes changed after 57c36d758f

This commit is contained in:
Ovahlord
2024-06-01 20:20:15 +02:00
parent e6f67b4920
commit 710a0f2681
4 changed files with 10 additions and 10 deletions

View File

@@ -529,12 +529,12 @@ void AuctionHouseMgr::LoadAuctions()
}
Item* item = NewItemOrBag(proto);
if (!item->LoadFromDB(itemGuid, ObjectGuid::Create<HighGuid::Player>(fields[52].GetUInt64()), fields, itemEntry))
if (!item->LoadFromDB(itemGuid, ObjectGuid::Create<HighGuid::Player>(fields[53].GetUInt64()), fields, itemEntry))
{
delete item;
continue;
}
uint32 auctionId = fields[53].GetUInt32();
uint32 auctionId = fields[54].GetUInt32();
itemsByAuction[auctionId].push_back(item);
++count;

View File

@@ -3863,7 +3863,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
do
{
Field* fields = resultItems->Fetch();
uint64 mailId = fields[53].GetUInt64();
uint64 mailId = fields[54].GetUInt64();
if (Item* mailItem = _LoadMailedItem(playerguid, nullptr, mailId, nullptr, fields, Trinity::Containers::MapGetValuePtr(additionalData, fields[0].GetUInt64())))
itemsByMail[mailId].push_back(mailItem);
@@ -18776,7 +18776,7 @@ Item* Player::_LoadMailedItem(ObjectGuid const& playerGuid, Player* player, uint
Item* item = NewItemOrBag(proto);
ObjectGuid ownerGuid = fields[52].GetUInt64() ? ObjectGuid::Create<HighGuid::Player>(fields[52].GetUInt64()) : ObjectGuid::Empty;
ObjectGuid ownerGuid = fields[53].GetUInt64() ? ObjectGuid::Create<HighGuid::Player>(fields[53].GetUInt64()) : ObjectGuid::Empty;
if (!item->LoadFromDB(itemGuid, ownerGuid, fields, itemEntry))
{
TC_LOG_ERROR("entities.player", "Player::_LoadMailedItems: Item (GUID: {}) in mail ({}) doesn't exist, deleted from mail.", itemGuid, mailId);

View File

@@ -377,7 +377,7 @@ void Guild::BankTab::LoadFromDB(Field* fields)
bool Guild::BankTab::LoadItemFromDB(Field* fields)
{
uint8 slotId = fields[54].GetUInt8();
uint8 slotId = fields[55].GetUInt8();
ObjectGuid::LowType itemGuid = fields[0].GetUInt64();
uint32 itemEntry = fields[1].GetUInt32();
if (slotId >= GUILD_BANK_MAX_SLOTS)
@@ -2642,7 +2642,7 @@ void Guild::LoadBankTabFromDB(Field* fields)
bool Guild::LoadBankItemFromDB(Field* fields)
{
uint8 tabId = fields[53].GetUInt8();
uint8 tabId = fields[54].GetUInt8();
if (tabId >= _GetPurchasedTabsSize())
{
TC_LOG_ERROR("guild", "Invalid tab for item (GUID: {}, id: #{}) in guild bank, skipped.",

View File

@@ -415,9 +415,9 @@ void GuildMgr::LoadGuilds()
// secondaryItemModifiedAppearanceSpec3, secondaryItemModifiedAppearanceSpec4, secondaryItemModifiedAppearanceSpec5,
// 38 39 40 41 42 43 44 45 46 47 48 49
// gemItemId1, gemBonuses1, gemContext1, gemScalingLevel1, gemItemId2, gemBonuses2, gemContext2, gemScalingLevel2, gemItemId3, gemBonuses3, gemContext3, gemScalingLevel3
// 50 51
// fixedScalingLevel, artifactKnowledgeLevel
// 52 53 54
// 50 51 52
// fixedScalingLevel, artifactKnowledgeLevel, itemReforgeId
// 53 54 55
// guildid, TabId, SlotId FROM guild_bank_item gbi INNER JOIN item_instance ii ON gbi.item_guid = ii.guid
PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_ITEMS));
@@ -431,7 +431,7 @@ void GuildMgr::LoadGuilds()
do
{
Field* fields = result->Fetch();
uint64 guildId = fields[52].GetUInt64();
uint64 guildId = fields[53].GetUInt64();
if (Guild* guild = GetGuildById(guildId))
guild->LoadBankItemFromDB(fields);