diff --git a/changelog.txt b/changelog.txt index c90bd9765..1b039d92d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,6 +11,7 @@ Uleat: Changed riposte enabling check to proper failure criteria (x == 1 && x == Uleat: Enforced naming standard on my recent changes (Sorry for any inconviencies) Uleat: Moved DeityTypes enumeration from eq_constants.h to deity.h (expanded utility of accessors, but are yet to be implemented) Uleat: Changed ItemUseType to ItemInstTypes to better reflect the definition (also to free-up the namespace) +Uleat: Changed ItemClass to ItemClassTypes == 10/24/2013 == demonstar55: Fix some memory leaks in Mob::SpellOnTarget diff --git a/common/Item.cpp b/common/Item.cpp index 457aed53f..69b336b1d 100644 --- a/common/Item.cpp +++ b/common/Item.cpp @@ -220,7 +220,7 @@ ItemInst* ItemInst::Clone() const } // Query item type -bool ItemInst::IsType(ItemClass item_class) const +bool ItemInst::IsType(ItemClassTypes item_class) const { // Check usage type if ((m_use_type == ItemInstWorldContainer) && (item_class == ItemClassContainer)) diff --git a/common/Item.h b/common/Item.h index 1b1fabf57..33f0ff12f 100644 --- a/common/Item.h +++ b/common/Item.h @@ -287,7 +287,7 @@ public: ~ItemInst(); // Query item type - bool IsType(ItemClass item_class) const; + bool IsType(ItemClassTypes item_class) const; // Can item be stacked? bool IsStackable() const; diff --git a/common/eq_constants.h b/common/eq_constants.h index eed310ca2..fc32d25f3 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -38,14 +38,15 @@ enum ItemAttributes : uint32 }; /* -** Item types +** Item class types ** */ -enum ItemClass +enum ItemClassTypes { - ItemClassCommon = 0, - ItemClassContainer = 1, - ItemClassBook = 2 + ItemClassCommon = 0, + ItemClassContainer, + ItemClassBook, + _ItemClassCount }; /* diff --git a/zone/lua_iteminst.cpp b/zone/lua_iteminst.cpp index 0427614d1..c774c332e 100644 --- a/zone/lua_iteminst.cpp +++ b/zone/lua_iteminst.cpp @@ -41,7 +41,7 @@ Lua_ItemInst::Lua_ItemInst(const Lua_ItemInst& o) { bool Lua_ItemInst::IsType(int item_class) { Lua_Safe_Call_Bool(); - return self->IsType(static_cast(item_class)); + return self->IsType(static_cast(item_class)); } bool Lua_ItemInst::IsStackable() { diff --git a/zone/perl_questitem.cpp b/zone/perl_questitem.cpp index fa5fd1c77..f9128718b 100644 --- a/zone/perl_questitem.cpp +++ b/zone/perl_questitem.cpp @@ -134,7 +134,7 @@ XS(XS_QuestItem_IsType) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->IsType((ItemClass)type); + RETVAL = THIS->IsType((ItemClassTypes)type); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); }