Core/Guild: Fix guildbank withdrawal limit (non-guildmaster character will not be able to withdraw more than withdraw-limit) - thanks to Azz

Fixes issue 4720

--HG--
branch : trunk
This commit is contained in:
click
2010-11-11 22:59:06 +01:00
parent 090acddee3
commit 5f4b97fcf7
+4 -1
View File
@@ -1669,12 +1669,15 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool
if (!remainingMoney)
return false;
if (remainingMoney < amount)
return false;
// Call script after validation and before money transfer.
sScriptMgr.OnGuildMemberWitdrawMoney(this, player, amount, repair);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
// Update remaining money amount
if (remainingMoney >= amount && remainingMoney < GUILD_WITHDRAW_MONEY_UNLIMITED)
if (remainingMoney < GUILD_WITHDRAW_MONEY_UNLIMITED)
if (Member* pMember = GetMember(player->GetGUID()))
pMember->DecreaseBankRemainingValue(trans, GUILD_BANK_MAX_TABS, amount);
// Remove money from bank