From 271238a8e0a0a109917f692eb648bd47f57cc93f Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 14 Aug 2009 19:00:12 -0500 Subject: [PATCH] *Do not allow player to delete COD mails. --HG-- branch : trunk --- src/game/Mail.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp index 94f40f0079..f0af479374 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; + Mail *m = _player->GetMail(mailId); + if(m) + { + if (m->COD > 0) + return; + m->state = MAIL_STATE_DELETED; + } + Player* pl = _player; pl->m_mailsUpdated = true; - Mail *m = pl->GetMail(mailId); - if(m) - m->state = MAIL_STATE_DELETED; + pl->SendMailResult(mailId, MAIL_DELETED, MAIL_OK); }