Core/Guilds: Prevent guild bank packet contents update hack from interfering with buying new bank tabs
Port From (https://github.com/TrinityCore/TrinityCore/commit/e3d0b803d7c5ed564aabe6d348b4f96a48ef39cc)
This commit is contained in:
@@ -2308,6 +2308,12 @@ namespace Game.Guilds
|
|||||||
if (member == null) // Shouldn't happen, just in case
|
if (member == null) // Shouldn't happen, just in case
|
||||||
return;
|
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;
|
||||||
|
|
||||||
GuildBankQueryResults packet = new();
|
GuildBankQueryResults packet = new();
|
||||||
|
|
||||||
packet.Money = m_bankMoney;
|
packet.Money = m_bankMoney;
|
||||||
@@ -2342,7 +2348,7 @@ namespace Game.Guilds
|
|||||||
GuildBankItemInfo itemInfo = new();
|
GuildBankItemInfo itemInfo = new();
|
||||||
|
|
||||||
itemInfo.Slot = slotId;
|
itemInfo.Slot = slotId;
|
||||||
itemInfo.Item.ItemID = tabItem.GetEntry();
|
itemInfo.Item = new ItemInstance(tabItem);
|
||||||
itemInfo.Count = (int)tabItem.GetCount();
|
itemInfo.Count = (int)tabItem.GetCount();
|
||||||
itemInfo.Charges = Math.Abs(tabItem.GetSpellCharges());
|
itemInfo.Charges = Math.Abs(tabItem.GetSpellCharges());
|
||||||
itemInfo.EnchantmentID = (int)tabItem.GetEnchantmentId(EnchantmentSlot.Perm);
|
itemInfo.EnchantmentID = (int)tabItem.GetEnchantmentId(EnchantmentSlot.Perm);
|
||||||
|
|||||||
@@ -275,10 +275,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
Guild guild = GetPlayer().GetGuild();
|
Guild guild = GetPlayer().GetGuild();
|
||||||
if (guild != null)
|
if (guild != null)
|
||||||
guild.SendBankList(this, packet.Tab, true/*packet.FullUpdate*/);
|
guild.SendBankList(this, packet.Tab, 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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user