mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/Mail: Moved gold check closer to where it is taken away
(cherry picked from commit 1dcb2904d5)
This commit is contained in:
@@ -127,17 +127,17 @@ void WorldSession::HandleSendMail(WorldPackets::Mail::SendMail& sendMail)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player->HasEnoughMoney(reqmoney) && !player->IsGameMaster())
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_ENOUGH_MONEY);
|
||||
return;
|
||||
}
|
||||
|
||||
auto mailCountCheckContinuation = [this, player = _player, receiverGuid, mailInfo = std::move(sendMail.Info), reqmoney, cost](uint32 receiverTeam, uint64 mailsCount, uint8 receiverLevel, uint32 receiverAccountId) mutable
|
||||
{
|
||||
if (_player != player)
|
||||
return;
|
||||
|
||||
if (!player->HasEnoughMoney(reqmoney) && !player->IsGameMaster())
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_ENOUGH_MONEY);
|
||||
return;
|
||||
}
|
||||
|
||||
// do not allow to have more than 100 mails in mailbox.. mails count is in opcode uint8!!! - so max can be 255..
|
||||
if (mailsCount > 100)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user