[8616] Some cleanups in WorldSession::SendMailTo

This commit is contained in:
VladimirMangos 2009-10-10 12:11:59 +04:00
parent 29e6601335
commit f5db4fc163
2 changed files with 16 additions and 19 deletions

View file

@ -818,19 +818,16 @@ void WorldSession::SendMailTo(Player* receiver, uint8 messageType, uint8 station
time_t deliver_time = time(NULL) + deliver_delay;
// expire time if COD 3 days, if no COD 30 days, if auction sale pending 1 hour
uint32 expire_delay;
if(messageType == MAIL_AUCTION && !mi && !money) // auction mail without any items and money
// auction mail without any items and money (auction sale note) pending 1 hour
if (messageType == MAIL_AUCTION && !mi && !money)
expire_delay = HOUR;
// mail from battlemaster (rewardmarks) should last only one day
else if (messageType == MAIL_CREATURE && sBattleGroundMgr.GetBattleMasterBG(sender_guidlow_or_entry) != BATTLEGROUND_TYPE_NONE)
expire_delay = DAY;
// default case: expire time if COD 3 days, if no COD 30 days
else
expire_delay = (COD > 0) ? 3 * DAY : 30 * DAY;
if (messageType == MAIL_CREATURE)
{
// mail from battlemaster (rewardmarks) should last only one day
BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(sender_guidlow_or_entry);
if (bgTypeId != BATTLEGROUND_TYPE_NONE)
expire_delay = DAY;
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8615"
#define REVISION_NR "8616"
#endif // __REVISION_NR_H__