fix(Core/Guild): Guild bank handling issues (#10724)

* fix(Core/Guild): Guild bank right issues

* and slots too
This commit is contained in:
Nefertumm
2022-02-17 21:22:28 -03:00
committed by GitHub
parent 1320013614
commit aef1bed593
2 changed files with 15 additions and 3 deletions

View File

@@ -279,9 +279,9 @@ public:
void SetSlots(uint32 _slots) { slots = _slots; }
void SetRights(uint8 _rights) { rights = _rights; }
int8 GetTabId() const { return tabId; }
int32 GetSlots() const { return slots; }
int8 GetRights() const { return rights; }
uint8 GetTabId() const { return tabId; }
uint32 GetSlots() const { return slots; }
uint8 GetRights() const { return rights; }
private:
uint8 tabId;

View File

@@ -180,11 +180,23 @@ void WorldSession::HandleGuildRankOpcode(WorldPackets::Guild::GuildSetRankPermis
for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId)
{
// For some reason the client is sending - 1 for guildmaster tab withdraw item limit, that's ilegal for us because we expect unsigned int.
// Probably core handling for this should be changed.
if (packet.TabWithdrawItemLimit[tabId] <= 0)
{
packet.TabWithdrawItemLimit[tabId] = uint32(GUILD_WITHDRAW_SLOT_UNLIMITED);
}
rightsAndSlots[tabId] = GuildBankRightsAndSlots(tabId, uint8(packet.TabFlags[tabId]), packet.TabWithdrawItemLimit[tabId]);
}
LOG_DEBUG("guild", "CMSG_GUILD_RANK [{}]: Rank: {} ({})", GetPlayerInfo(), packet.RankName, packet.RankID);
// Same as the issue above but this time with rights.
if (packet.Flags <= 0)
{
packet.Flags = GUILD_BANK_RIGHT_FULL;
}
guild->HandleSetRankInfo(this, packet.RankID, packet.RankName, packet.Flags, packet.WithdrawGoldLimit, rightsAndSlots);
}