mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 13:22:48 +01:00
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:
@@ -1046,9 +1046,12 @@ public:
|
||||
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), moneyToAdd);
|
||||
|
||||
if (moneyToAdd >= MAX_MONEY_AMOUNT)
|
||||
target->SetMoney(MAX_MONEY_AMOUNT);
|
||||
else
|
||||
target->ModifyMoney(moneyToAdd);
|
||||
moneyToAdd = MAX_MONEY_AMOUNT;
|
||||
|
||||
if (targetMoney >= uint32(MAX_MONEY_AMOUNT) - moneyToAdd)
|
||||
moneyToAdd -= targetMoney;
|
||||
|
||||
target->ModifyMoney(moneyToAdd);
|
||||
}
|
||||
|
||||
sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), targetMoney, moneyToAdd, target->GetMoney());
|
||||
|
||||
Reference in New Issue
Block a user