fix(Core/Guilds): Implement guild bank gold limit matching client (#9666)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
Kitzunu
2021-12-17 18:06:32 +01:00
committed by GitHub
parent 0dd59e66d3
commit 9eab6d373d
2 changed files with 8 additions and 0 deletions

View File

@@ -1628,6 +1628,12 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount)
// Call script after validation and before money transfer.
sScriptMgr->OnGuildMemberDepositMoney(this, player, amount);
if (m_bankMoney > GUILD_BANK_MONEY_LIMIT - amount)
{
SendCommandResult(session, GUILD_COMMAND_MOVE_ITEM, ERR_GUILD_BANK_FULL);
return;
}
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
_ModifyBankMoney(trans, amount, true);