Core/Players: Prevent trading, taking gold from mail and withdrawing from guild bank if it would put the player over gold cap.
Closes #4015
This commit is contained in:
1 parent
dc5e9c80fc
commit
0bf29d45d1
6 files changed
+52
-23
No files matched your search
@@ -1755,16 +1755,20 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool
|
||||
sScriptMgr->OnGuildMemberWitdrawMoney(this, player, amount, repair);
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
// Add money to player (if required)
|
||||
if (!repair)
|
||||
{
|
||||
if (!player->ModifyMoney(amount))
|
||||
return false;
|
||||
|
||||
player->SaveGoldToDB(trans);
|
||||
}
|
||||
|
||||
// Update remaining money amount
|
||||
member->UpdateBankWithdrawValue(trans, GUILD_BANK_MAX_TABS, amount);
|
||||
// Remove money from bank
|
||||
_ModifyBankMoney(trans, amount, false);
|
||||
// Add money to player (if required)
|
||||
if (!repair)
|
||||
{
|
||||
player->ModifyMoney(amount);
|
||||
player->SaveGoldToDB(trans);
|
||||
}
|
||||
|
||||
// Log guild bank event
|
||||
_LogBankEvent(trans, repair ? GUILD_BANK_LOG_REPAIR_MONEY : GUILD_BANK_LOG_WITHDRAW_MONEY, uint8(0), player->GetGUIDLow(), amount);
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
Reference in new issue
Block a user