diff options
author | megamage <none@none> | 2009-08-14 19:00:12 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-14 19:00:12 -0500 |
commit | 271238a8e0a0a109917f692eb648bd47f57cc93f (patch) | |
tree | 5316f5022e62bbb08535eb1d8f0e54b300d1d22c /src/game/Mail.cpp | |
parent | 6890d8aedbf15f97cc6bc4c764f9a1785862555c (diff) |
*Do not allow player to delete COD mails.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Mail.cpp')
-rw-r--r-- | src/game/Mail.cpp | 12 |
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); } |