diff options
author | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
commit | 26b5e033ffde3d161382fc9addbfa99738379641 (patch) | |
tree | a344f369ca32945f787a02dee35c3dbe342bed7e /src/game/Mail.h | |
parent | f21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff) |
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget
--HG--
branch : trunk
Diffstat (limited to 'src/game/Mail.h')
-rw-r--r-- | src/game/Mail.h | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/game/Mail.h b/src/game/Mail.h index 8cbe46e6396..5dc8cb5fd3d 100644 --- a/src/game/Mail.h +++ b/src/game/Mail.h @@ -19,15 +19,11 @@ */ #ifndef TRINITY_MAIL_H #define TRINITY_MAIL_H - #include "Common.h" #include <map> - class Item; - #define MAIL_BODY_ITEM_TEMPLATE 8383 // - plain letter, A Dusty Unsent Letter: 889 #define MAX_MAIL_ITEMS 12 - enum MailCheckMask { MAIL_CHECK_MASK_NONE = 0, @@ -36,7 +32,6 @@ enum MailCheckMask MAIL_CHECK_MASK_COD_PAYMENT = 8, MAIL_CHECK_MASK_RETURNED = 16 }; - enum MailMessageType { MAIL_NORMAL = 0, @@ -45,14 +40,12 @@ enum MailMessageType MAIL_GAMEOBJECT = 4, // client send CMSG_GAMEOBJECT_QUERY on this mailmessagetype MAIL_ITEM = 5, // client send CMSG_ITEM_QUERY on this mailmessagetype }; - enum MailState { MAIL_STATE_UNCHANGED = 1, MAIL_STATE_CHANGED = 2, MAIL_STATE_DELETED = 3 }; - enum MailAuctionAnswers { AUCTION_OUTBIDDED = 0, @@ -63,7 +56,6 @@ enum MailAuctionAnswers AUCTION_CANCELED = 5, AUCTION_SALE_PENDING = 6 }; - // gathered from Stationery.dbc enum MailStationery { @@ -74,27 +66,21 @@ enum MailStationery MAIL_STATIONERY_VAL = 0x40, MAIL_STATIONERY_CHR = 0x41 }; - struct MailItemInfo { uint32 item_guid; uint32 item_template; }; - struct MailItem { MailItem() : item_slot(0), item_guidlow(0), item_template(0), item(NULL) {} - uint8 item_slot; // slot in mail uint32 item_guidlow; // item guid (low part) uint32 item_template; // item entry Item *item; // item pointer - void deleteItem(bool inDB = false); }; - typedef std::map<uint32, MailItem> MailItemMap; - class MailItemsInfo { public: @@ -102,7 +88,6 @@ class MailItemsInfo MailItemMap::const_iterator end() const { return i_MailItemMap.end(); } MailItemMap::iterator begin() { return i_MailItemMap.begin(); } MailItemMap::iterator end() { return i_MailItemMap.end(); } - void AddItem(uint32 guidlow, uint32 _template, Item *item, uint8 slot = 0) { MailItem mailItem; @@ -112,7 +97,6 @@ class MailItemsInfo mailItem.item = item; i_MailItemMap[guidlow] = mailItem; } - void AddItem(uint32 guidlow, uint8 slot = 0) { MailItem mailItem; @@ -120,10 +104,8 @@ class MailItemsInfo mailItem.item_slot = slot; i_MailItemMap[guidlow] = mailItem; } - uint8 size() const { return i_MailItemMap.size(); } bool empty() const { return i_MailItemMap.empty(); } - void deleteIncludedItems(bool inDB = false) { for(MailItemMap::iterator mailItemIter = begin(); mailItemIter != end(); ++mailItemIter) @@ -135,7 +117,6 @@ class MailItemsInfo private: MailItemMap i_MailItemMap; // Keep the items in a map to avoid duplicate guids (which can happen), store only low part of guid }; - struct Mail { uint32 messageID; @@ -154,7 +135,6 @@ struct Mail uint32 COD; uint32 checked; MailState state; - void AddItem(uint32 itemGuidLow, uint32 item_template) { MailItemInfo mii; @@ -162,7 +142,6 @@ struct Mail mii.item_template = item_template; items.push_back(mii); } - void AddAllItems(MailItemsInfo& pMailItemsInfo) { for(MailItemMap::iterator mailItemIter = pMailItemsInfo.begin(); mailItemIter != pMailItemsInfo.end(); ++mailItemIter) @@ -171,7 +150,6 @@ struct Mail AddItem(mailItem.item_guidlow, mailItem.item_template); } } - bool RemoveItem(uint32 item_guid) { for(std::vector<MailItemInfo>::iterator itr = items.begin(); itr != items.end(); ++itr) @@ -184,7 +162,6 @@ struct Mail } return false; } - bool HasItems() const { return !items.empty(); } }; #endif |