mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[8766] Restore build at Unix/Linux after recent commits.
This commit is contained in:
parent
c90ded3ec3
commit
e79af61266
3 changed files with 30 additions and 24 deletions
|
|
@ -29,6 +29,7 @@
|
||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
#include "DBCStores.h"
|
#include "DBCStores.h"
|
||||||
#include "BattleGroundMgr.h"
|
#include "BattleGroundMgr.h"
|
||||||
|
#include "Item.h"
|
||||||
|
|
||||||
enum MailShowFlags
|
enum MailShowFlags
|
||||||
{
|
{
|
||||||
|
|
@ -39,6 +40,31 @@ enum MailShowFlags
|
||||||
MAIL_SHOW_RETURN = 0x0010,
|
MAIL_SHOW_RETURN = 0x0010,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void MailItemsInfo::deleteIncludedItems( bool inDB /*= false*/ )
|
||||||
|
{
|
||||||
|
for(MailItemMap::iterator mailItemIter = begin(); mailItemIter != end(); ++mailItemIter)
|
||||||
|
{
|
||||||
|
Item* item = mailItemIter->second;
|
||||||
|
|
||||||
|
if(inDB)
|
||||||
|
CharacterDatabase.PExecute("DELETE FROM item_instance WHERE guid='%u'", item->GetGUIDLow());
|
||||||
|
|
||||||
|
delete item;
|
||||||
|
}
|
||||||
|
|
||||||
|
i_MailItemMap.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Mail::AddAllItems( MailItemsInfo& pMailItemsInfo )
|
||||||
|
{
|
||||||
|
for(MailItemMap::iterator mailItemIter = pMailItemsInfo.begin(); mailItemIter != pMailItemsInfo.end(); ++mailItemIter)
|
||||||
|
{
|
||||||
|
Item* item = mailItemIter->second;
|
||||||
|
AddItem(item->GetGUIDLow(), item->GetEntry());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
uint64 mailbox, unk3;
|
uint64 mailbox, unk3;
|
||||||
|
|
@ -201,7 +227,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||||
|
|
||||||
pl->SendMailResult(0, MAIL_SEND, MAIL_OK);
|
pl->SendMailResult(0, MAIL_SEND, MAIL_OK);
|
||||||
|
|
||||||
uint32 itemTextId = !body.empty() ? itemTextId = objmgr.CreateItemText( body ) : 0;
|
uint32 itemTextId = !body.empty() ? objmgr.CreateItemText( body ) : 0;
|
||||||
|
|
||||||
pl->ModifyMoney( -int32(reqmoney) );
|
pl->ModifyMoney( -int32(reqmoney) );
|
||||||
pl->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost);
|
pl->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost);
|
||||||
|
|
|
||||||
|
|
@ -98,20 +98,7 @@ class MailItemsInfo
|
||||||
uint8 size() const { return i_MailItemMap.size(); }
|
uint8 size() const { return i_MailItemMap.size(); }
|
||||||
bool empty() const { return i_MailItemMap.empty(); }
|
bool empty() const { return i_MailItemMap.empty(); }
|
||||||
|
|
||||||
void deleteIncludedItems(bool inDB = false)
|
void deleteIncludedItems(bool inDB = false);
|
||||||
{
|
|
||||||
for(MailItemMap::iterator mailItemIter = begin(); mailItemIter != end(); ++mailItemIter)
|
|
||||||
{
|
|
||||||
Item* item = mailItemIter->second;
|
|
||||||
|
|
||||||
if(inDB)
|
|
||||||
CharacterDatabase.PExecute("DELETE FROM item_instance WHERE guid='%u'", item->GetGUIDLow());
|
|
||||||
|
|
||||||
delete item;
|
|
||||||
}
|
|
||||||
|
|
||||||
i_MailItemMap.clear();
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
MailItemMap i_MailItemMap; // Keep the items in a map to avoid duplicate guids (which can happen), store only low part of guid
|
MailItemMap i_MailItemMap; // Keep the items in a map to avoid duplicate guids (which can happen), store only low part of guid
|
||||||
};
|
};
|
||||||
|
|
@ -143,14 +130,7 @@ struct Mail
|
||||||
items.push_back(mii);
|
items.push_back(mii);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddAllItems(MailItemsInfo& pMailItemsInfo)
|
void AddAllItems(MailItemsInfo& pMailItemsInfo);
|
||||||
{
|
|
||||||
for(MailItemMap::iterator mailItemIter = pMailItemsInfo.begin(); mailItemIter != pMailItemsInfo.end(); ++mailItemIter)
|
|
||||||
{
|
|
||||||
Item* item = mailItemIter->second;
|
|
||||||
AddItem(item->GetGUIDLow(), item->GetEntry());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RemoveItem(uint32 item_guid)
|
bool RemoveItem(uint32 item_guid)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8765"
|
#define REVISION_NR "8766"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue