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:
@@ -1669,12 +1669,15 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool
|
|||||||
if (!remainingMoney)
|
if (!remainingMoney)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (remainingMoney < amount)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Call script after validation and before money transfer.
|
// Call script after validation and before money transfer.
|
||||||
sScriptMgr.OnGuildMemberWitdrawMoney(this, player, amount, repair);
|
sScriptMgr.OnGuildMemberWitdrawMoney(this, player, amount, repair);
|
||||||
|
|
||||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||||
// Update remaining money amount
|
// Update remaining money amount
|
||||||
if (remainingMoney >= amount && remainingMoney < GUILD_WITHDRAW_MONEY_UNLIMITED)
|
if (remainingMoney < GUILD_WITHDRAW_MONEY_UNLIMITED)
|
||||||
if (Member* pMember = GetMember(player->GetGUID()))
|
if (Member* pMember = GetMember(player->GetGUID()))
|
||||||
pMember->DecreaseBankRemainingValue(trans, GUILD_BANK_MAX_TABS, amount);
|
pMember->DecreaseBankRemainingValue(trans, GUILD_BANK_MAX_TABS, amount);
|
||||||
// Remove money from bank
|
// Remove money from bank
|
||||||
|
|||||||
Reference in New Issue
Block a user