diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-12-06 21:24:50 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-12-06 21:30:28 +0100 |
commit | 4b9bb32cdc019a4b2ff72e056dab01c9c8cd6514 (patch) | |
tree | f5a2db99fa43a95b436298d125b0cd55b9519188 /src | |
parent | a28bdcba23ed3c2a053051c22b49d722283f662d (diff) |
Core/Guilds: Prevent guild bank packet contents update hack from interfering with buying new bank tabs
Closes #30277
(cherry picked from commit e3d0b803d7c5ed564aabe6d348b4f96a48ef39cc)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Guilds/Guild.cpp | 8 | ||||
-rw-r--r-- | src/server/game/Handlers/GuildHandler.cpp | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index df4855208d5..ac91cf6a929 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -3633,6 +3633,12 @@ void Guild::SendBankList(WorldSession* session, uint8 tabId, bool fullUpdate) co if (!member) // Shouldn't happen, just in case return; + // HACK: client doesn't query entire tab content if it had received SMSG_GUILD_BANK_LIST in this session + // but we broadcast bank updates to entire guild when *ANYONE* changes anything, incorrectly initializing clients + // tab content with only data for that change + if (!fullUpdate && tabId < _GetPurchasedTabsSize()) + fullUpdate = true; + WorldPackets::Guild::GuildBankQueryResults packet; packet.Money = m_bankMoney; @@ -3674,7 +3680,7 @@ void Guild::SendBankList(WorldSession* session, uint8 tabId, bool fullUpdate) co WorldPackets::Guild::GuildBankItemInfo& itemInfo = packet.ItemInfo.emplace_back(); itemInfo.Slot = int32(slotId); - itemInfo.Item.ItemID = tabItem->GetEntry(); + itemInfo.Item.Initialize(tabItem); itemInfo.Count = int32(tabItem->GetCount()); itemInfo.Charges = int32(abs(tabItem->GetSpellCharges())); itemInfo.EnchantmentID = int32(tabItem->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 13ebcca031f..c778ca97ca8 100644 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -260,10 +260,7 @@ void WorldSession::HandleGuildBankQueryTab(WorldPackets::Guild::GuildBankQueryTa if (GetPlayer()->GetGameObjectIfCanInteractWith(packet.Banker, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = GetPlayer()->GetGuild()) - guild->SendBankList(this, packet.Tab, true /*packet.FullUpdate*/); - // HACK: client doesn't query entire tab content if it had received SMSG_GUILD_BANK_LIST in this session - // but we broadcast bank updates to entire guild when *ANYONE* changes anything, incorrectly initializing clients - // tab content with only data for that change + guild->SendBankList(this, packet.Tab, packet.FullUpdate); } void WorldSession::HandleGuildBankDepositMoney(WorldPackets::Guild::GuildBankDepositMoney& packet) |