summaryrefslogtreecommitdiffstats
path: root/src/Item.cpp
diff options
context:
space:
mode:
authorHownaer <franzi.moos@googlemail.com>2014-08-28 01:21:54 +0200
committerHownaer <franzi.moos@googlemail.com>2014-08-28 01:21:54 +0200
commit0f1fd3312332da2a6104c9eb98625610a4a08eff (patch)
treeda0e5d5f4d98b99e56090477c0da87faeef1ebf4 /src/Item.cpp
parentFixed ItemCategory code example. (diff)
downloadcuberite-0f1fd3312332da2a6104c9eb98625610a4a08eff.tar
cuberite-0f1fd3312332da2a6104c9eb98625610a4a08eff.tar.gz
cuberite-0f1fd3312332da2a6104c9eb98625610a4a08eff.tar.bz2
cuberite-0f1fd3312332da2a6104c9eb98625610a4a08eff.tar.lz
cuberite-0f1fd3312332da2a6104c9eb98625610a4a08eff.tar.xz
cuberite-0f1fd3312332da2a6104c9eb98625610a4a08eff.tar.zst
cuberite-0f1fd3312332da2a6104c9eb98625610a4a08eff.zip
Diffstat (limited to 'src/Item.cpp')
-rw-r--r--src/Item.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/Item.cpp b/src/Item.cpp
index 2c5deaddf..a5117c271 100644
--- a/src/Item.cpp
+++ b/src/Item.cpp
@@ -190,31 +190,23 @@ void cItem::FromJson(const Json::Value & a_Value)
-bool cItem::IsEnchantable(short item)
+bool cItem::IsEnchantable(short a_ItemType)
{
- if ((item >= 256) && (item <= 259))
+ if (ItemCategory::IsTool(a_ItemType) || ItemCategory::IsArmor(a_ItemType))
{
return true;
}
- if ((item >= 267) && (item <= 279))
- {
- return true;
- }
- if ((item >= 283) && (item <= 286))
- {
- return true;
- }
- if ((item >= 290) && (item <= 294))
- {
- return true;
- }
- if ((item >= 298) && (item <= 317))
- {
- return true;
- }
- if ((item == 346) || (item == 359) || (item == 261))
+
+ switch (a_ItemType)
{
- return true;
+ case E_ITEM_BOOK:
+ case E_ITEM_BOW:
+ case E_ITEM_CARROT_ON_STICK:
+ case E_ITEM_FISHING_ROD:
+ case E_ITEM_SHEARS:
+ {
+ return true;
+ }
}
return false;