aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-11-07 19:15:21 +0100
committerShauren <shauren.trinity@gmail.com>2023-11-07 19:15:21 +0100
commit1dcb2904d5b5a6c12f5f3b56e44c74e4a79b9626 (patch)
treec09a24c5e95eff0f0e43dc566b6b2296a5b38821 /src/server
parent30759beac75ef5bd6024e51213804a56673e6680 (diff)
Core/Mail: Moved gold check closer to where it is taken away
Diffstat (limited to 'src/server')
-rw-r--r--src/server/game/Handlers/MailHandler.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp
index 201342b4dfa..72320134a8c 100644
--- a/src/server/game/Handlers/MailHandler.cpp
+++ b/src/server/game/Handlers/MailHandler.cpp
@@ -138,17 +138,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, uint32 receiverBnetAccountId) 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)
{