aboutsummaryrefslogtreecommitdiff
path: root/src/game/Mail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Mail.cpp')
-rw-r--r--src/game/Mail.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
index 94f40f0079e..f0af479374c 100644
--- a/src/game/Mail.cpp
+++ b/src/game/Mail.cpp
@@ -336,11 +336,17 @@ void WorldSession::HandleMailDelete(WorldPacket & recv_data )
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
return;
- Player* pl = _player;
- pl->m_mailsUpdated = true;
- Mail *m = pl->GetMail(mailId);
+ Mail *m = _player->GetMail(mailId);
if(m)
+ {
+ if (m->COD > 0)
+ return;
m->state = MAIL_STATE_DELETED;
+ }
+
+ Player* pl = _player;
+ pl->m_mailsUpdated = true;
+
pl->SendMailResult(mailId, MAIL_DELETED, MAIL_OK);
}