aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level1.cpp
diff options
context:
space:
mode:
authorwin32 <none@none>2009-12-16 18:58:36 +0200
committerwin32 <none@none>2009-12-16 18:58:36 +0200
commitbf2c3fd8cf32578324162a8bef2ac6e48e7e0009 (patch)
treeccb8f71a159aba2799cc009352a8626d95b6fc6c /src/game/Level1.cpp
parentdc53b4a9def06d012d791304aaba1c748a1f997a (diff)
MaNGOS merge: Mail System.
* Store loot in mail_loot_template indexed by mail template ids. * Implement proper creating mail text copy item from mail template based mail. * Move send functions to new MailDraft class from WorldSession. * Implement mails sending at player levelup. * Autor VladimirMangos, converted by me. --HG-- branch : trunk
Diffstat (limited to 'src/game/Level1.cpp')
-rw-r--r--src/game/Level1.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index 49802dd3790..4ae90ebdcc3 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -2439,13 +2439,12 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
std::string text = msgText;
// from console show not existed sender
- uint32 sender_guidlo = m_session ? m_session->GetPlayer()->GetGUIDLow() : 0;
+ MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
- uint32 messagetype = MAIL_NORMAL;
- uint32 stationery = MAIL_STATIONERY_GM;
uint32 itemTextId = !text.empty() ? objmgr.CreateItemText( text ) : 0;
- WorldSession::SendMailTo(target,messagetype, stationery, sender_guidlo, GUID_LOPART(target_guid), subject, itemTextId, NULL, 0, 0, MAIL_CHECK_MASK_NONE);
+ MailDraft(subject, itemTextId)
+ .SendMailTo(MailReceiver(target,GUID_LOPART(target_guid)),sender);
std::string nameLink = playerLink(target_name);
PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());