Core/Mail: Moved gold check closer to where it is taken away

Port From (https://github.com/TrinityCore/TrinityCore/commit/1dcb2904d5b5a6c12f5f3b56e44c74e4a79b9626)
This commit is contained in:
hondacrx
2024-02-02 15:06:24 -05:00
parent d9e524a657
commit 75201f56ce
+6 -6
View File
@@ -121,17 +121,17 @@ namespace Game
return; return;
} }
void mailCountCheckContinuation(Team receiverTeam, ulong mailsCount, uint receiverLevel, uint receiverAccountId, uint receiverBnetAccountId)
{
if (_player != player)
return;
if (!player.HasEnoughMoney(reqmoney) && !player.IsGameMaster()) if (!player.HasEnoughMoney(reqmoney) && !player.IsGameMaster())
{ {
player.SendMailResult(0, MailResponseType.Send, MailResponseResult.NotEnoughMoney); player.SendMailResult(0, MailResponseType.Send, MailResponseResult.NotEnoughMoney);
return; return;
} }
void mailCountCheckContinuation(Team receiverTeam, ulong mailsCount, uint receiverLevel, uint receiverAccountId, uint receiverBnetAccountId)
{
if (_player != player)
return;
// do not allow to have more than 100 mails in mailbox.. mails count is in opcode uint8!!! - so max can be 255.. // 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) if (mailsCount > 100)
{ {
@@ -478,7 +478,7 @@ namespace Game
{ {
new MailDraft(m.subject, "") new MailDraft(m.subject, "")
.AddMoney(m.COD) .AddMoney(m.COD)
.SendMailTo(trans, new MailReceiver(receiver, m.sender), new MailSender( MailMessageType.Normal, m.receiver), MailCheckMask.CodPayment); .SendMailTo(trans, new MailReceiver(receiver, m.sender), new MailSender(MailMessageType.Normal, m.receiver), MailCheckMask.CodPayment);
} }
player.ModifyMoney(-(long)m.COD); player.ModifyMoney(-(long)m.COD);