From eb3ed1aec1fb9e4468a7829cabd42572b7554d70 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 19 Aug 2012 11:51:17 +0000 Subject: Another handful of packets rewritten. Also changed cItem::m_ItemID into m_ItemType of type short. Easier handling. m_ItemID kept for compatibility reasons (Lua-interface etc.) git-svn-id: http://mc-server.googlecode.com/svn/trunk@756 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cItem.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'source/cItem.h') diff --git a/source/cItem.h b/source/cItem.h index 53764d06a..aa4b76bbc 100644 --- a/source/cItem.h +++ b/source/cItem.h @@ -16,25 +16,28 @@ namespace Json class cItem { public: - cItem( ENUM_ITEM_ID a_ItemID = E_ITEM_EMPTY, char a_ItemCount = 0, short a_ItemHealth = 0 ) - : m_ItemID ( a_ItemID ) - , m_ItemCount ( a_ItemCount ) - , m_ItemHealth ( a_ItemHealth ) + cItem(short a_ItemType = E_ITEM_EMPTY, char a_ItemCount = 0, short a_ItemHealth = 0) + : m_ItemType (a_ItemType) + , m_ItemCount (a_ItemCount) + , m_ItemHealth(a_ItemHealth) { - if(!IsValidItem( m_ItemID ) ) m_ItemID = E_ITEM_EMPTY; + if (!IsValidItem( m_ItemID ) ) m_ItemID = E_ITEM_EMPTY; } + void Empty() { m_ItemID = E_ITEM_EMPTY; m_ItemCount = 0; m_ItemHealth = 0; } + void Clear(void) { m_ItemID = E_ITEM_EMPTY; m_ItemCount = 0; m_ItemHealth = 0; } + bool IsEmpty(void) const { return (m_ItemID <= 0 || m_ItemCount <= 0); @@ -120,8 +123,8 @@ public: union { // tolua_begin - ENUM_ITEM_ID m_ItemID; // OBSOLETE, use m_ItemType instead - short m_ItemType; + short m_ItemID; // OBSOLETE, use m_ItemType instead + short m_ItemType; // tolua_end } ; char m_ItemCount; // tolua_export -- cgit v1.2.3