Changed ItemUseType enumeration to ItemInstTypes enumeration - naming conflicted with definition

This commit is contained in:
Uleat
2013-10-27 05:45:52 -04:00
parent d5152a0e59
commit e53fa1d873
5 changed files with 18 additions and 15 deletions
+3 -3
View File
@@ -54,7 +54,7 @@ static inline int32 GetNextItemInstSerialNumber() {
}
ItemInst::ItemInst(const Item_Struct* item, int16 charges) {
m_use_type = ItemUseNormal;
m_use_type = ItemInstNormal;
m_item = item;
m_charges = charges;
m_price = 0;
@@ -76,7 +76,7 @@ ItemInst::ItemInst(const Item_Struct* item, int16 charges) {
}
ItemInst::ItemInst(SharedDatabase *db, uint32 item_id, int16 charges) {
m_use_type = ItemUseNormal;
m_use_type = ItemInstNormal;
m_item = db->GetItem(item_id);
m_charges = charges;
m_price = 0;
@@ -223,7 +223,7 @@ ItemInst* ItemInst::Clone() const
bool ItemInst::IsType(ItemClass item_class) const
{
// Check usage type
if ((m_use_type == ItemUseWorldContainer) && (item_class == ItemClassContainer))
if ((m_use_type == ItemInstWorldContainer) && (item_class == ItemClassContainer))
return true;
if (!m_item)
+11 -9
View File
@@ -39,13 +39,15 @@ class EvolveInfo; // Stores information about an evolving item family
#include "../common/timer.h"
// Helper typedefs
typedef std::list<ItemInst*>::const_iterator iter_queue;
typedef std::list<ItemInst*>::const_iterator iter_queue;
typedef std::map<int16, ItemInst*>::const_iterator iter_inst;
typedef std::map<uint8, ItemInst*>::const_iterator iter_contents;
namespace ItemField {
enum {
source=0,
namespace ItemField
{
enum
{
source = 0,
#define F(x) x,
#include "item_fieldlist.h"
#undef F
@@ -69,10 +71,10 @@ namespace ItemField {
#define MAX_ITEMS_PER_BAG 10
// Specifies usage type for item inside ItemInst
enum ItemUseType
enum ItemInstTypes
{
ItemUseNormal,
ItemUseWorldContainer
ItemInstNormal = 0,
ItemInstWorldContainer
};
typedef enum {
@@ -263,7 +265,7 @@ public:
ItemInst(SharedDatabase *db, uint32 item_id, int16 charges = 0);
ItemInst(ItemUseType use_type) {
ItemInst(ItemInstTypes use_type) {
m_use_type = use_type;
m_item = nullptr;
m_charges = 0;
@@ -421,7 +423,7 @@ protected:
void _PutItem(uint8 index, ItemInst* inst) { m_contents[index] = inst; }
ItemUseType m_use_type; // Usage type for item
ItemInstTypes m_use_type; // Usage type for item
const Item_Struct* m_item; // Ptr to item data
int16 m_charges; // # of charges for chargeable items
uint32 m_price; // Bazaar /trader price