aboutsummaryrefslogtreecommitdiff
path: root/src/game/Mail.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-23 14:23:25 -0600
committermegamage <none@none>2009-01-23 14:23:25 -0600
commitf0ebb960642ad0fa43fa49fd3cc76f6516de6cd3 (patch)
treea6fa76445cfa07bf060a473ad1910c724fa679a4 /src/game/Mail.cpp
parentb28b8b5ced6f0e0a7b52403010a7b465b5a765ae (diff)
parentc3ce24c30fc824d73f719780d7791a0095c14d61 (diff)
*Update to HG 957.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Mail.cpp')
-rw-r--r--src/game/Mail.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
index 3d4126bd22a..398b6c42ada 100644
--- a/src/game/Mail.cpp
+++ b/src/game/Mail.cpp
@@ -30,6 +30,7 @@
#include "Unit.h"
#include "Language.h"
#include "Database/DBCStores.h"
+#include "AuctionHouseBot.h"
void MailItem::deleteItem( bool inDB )
{
@@ -348,7 +349,14 @@ void WorldSession::HandleReturnToSender(WorldPacket & recv_data )
}
}
- SendReturnToSender(MAIL_NORMAL, GetAccountId(), m->receiver, m->sender, m->subject, m->itemTextId, &mi, m->money, m->mailTemplateId);
+ if (m->sender == AHBplayerGUID)
+ {
+ SendReturnToSender(MAIL_CREATURE, GetAccountId(), m->receiver, m->sender, m->subject, m->itemTextId, &mi, m->money, m->mailTemplateId);
+ }
+ else
+ {
+ SendReturnToSender(MAIL_NORMAL, GetAccountId(), m->receiver, m->sender, m->subject, m->itemTextId, &mi, m->money, m->mailTemplateId);
+ }
delete m; //we can deallocate old mail
pl->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, 0);
@@ -767,6 +775,14 @@ void WorldSession::HandleMsgQueryNextMailtime(WorldPacket & /*recv_data*/ )
void WorldSession::SendMailTo(Player* receiver, uint8 messageType, uint8 stationery, uint32 sender_guidlow_or_entry, uint32 receiver_guidlow, std::string subject, uint32 itemTextId, MailItemsInfo* mi, uint32 money, uint32 COD, uint32 checked, uint32 deliver_delay, uint16 mailTemplateId)
{
+ if (receiver_guidlow == AHBplayerGUID)
+ {
+ if(messageType == MAIL_AUCTION && mi) // auction mail with items
+ {
+ mi->deleteIncludedItems(true);
+ }
+ return;
+ }
uint32 mailId = objmgr.GenerateMailID();
time_t deliver_time = time(NULL) + deliver_delay;