From 79f984144951b27b54dfc050e06cce89c4499441 Mon Sep 17 00:00:00 2001 From: faketruth Date: Wed, 13 Jun 2012 18:14:20 +0000 Subject: Exported the ItemCategory functions and added a IsTool() function to it, for easy checking whether an item is a tool git-svn-id: http://mc-server.googlecode.com/svn/trunk@603 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Defines.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source/Defines.h') diff --git a/source/Defines.h b/source/Defines.h index 444aef683..fae466e4a 100644 --- a/source/Defines.h +++ b/source/Defines.h @@ -192,7 +192,7 @@ inline float GetSpecialSignf( float a_Val ) - +//tolua_begin namespace ItemCategory { inline bool IsPickaxe(ENUM_ITEM_ID a_ItemID) @@ -247,10 +247,21 @@ namespace ItemCategory || (a_ItemID == E_ITEM_GOLD_SHOVEL) || (a_ItemID == E_ITEM_DIAMOND_SHOVEL); } -} + inline bool IsTool(ENUM_ITEM_ID a_ItemID) + { + return IsPickaxe( a_ItemID ) + || IsAxe ( a_ItemID ) + || IsSword ( a_ItemID ) + || IsHoe ( a_ItemID ) + || IsShovel ( a_ItemID ); + } +} +//tolua_end + + //tolua_begin -- cgit v1.2.3