summaryrefslogtreecommitdiffstats
path: root/src/Item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Item.cpp')
-rw-r--r--src/Item.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/Item.cpp b/src/Item.cpp
index 56ceae0b7..b44472e38 100644
--- a/src/Item.cpp
+++ b/src/Item.cpp
@@ -162,11 +162,11 @@ void cItem::GetJson(Json::Value & a_OutValue) const
void cItem::FromJson(const Json::Value & a_Value)
{
- m_ItemType = (ENUM_ITEM_ID)a_Value.get("ID", -1 ).asInt();
+ m_ItemType = (ENUM_ITEM_ID)a_Value.get("ID", -1).asInt();
if (m_ItemType > 0)
{
- m_ItemCount = (char)a_Value.get("Count", -1 ).asInt();
- m_ItemDamage = (short)a_Value.get("Health", -1 ).asInt();
+ m_ItemCount = (char)a_Value.get("Count", -1).asInt();
+ m_ItemDamage = (short)a_Value.get("Health", -1).asInt();
m_Enchantments.Clear();
m_Enchantments.AddFromString(a_Value.get("ench", "").asString());
m_CustomName = a_Value.get("Name", "").asString();
@@ -193,17 +193,29 @@ void cItem::FromJson(const Json::Value & a_Value)
bool cItem::IsEnchantable(short item)
{
if ((item >= 256) && (item <= 259))
+ {
return true;
+ }
if ((item >= 267) && (item <= 279))
+ {
return true;
- if ((item >= 283) && (item <= 286))
+ }
+ 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))
+ {
return true;
+ }
return false;
}
@@ -363,7 +375,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
// cItems:
cItem * cItems::Get(int a_Idx)