1
0

Merged branch "branches/hooks" into "trunk".

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1139 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-01-12 04:46:01 +00:00
parent 71d71410fd
commit 43e6840719
113 changed files with 3762 additions and 5535 deletions

View File

@@ -10,21 +10,21 @@
void cItem::GetJson( Json::Value & a_OutValue ) const
{
a_OutValue["ID"] = m_ItemID;
if( m_ItemID > 0 )
a_OutValue["ID"] = m_ItemType;
if( m_ItemType > 0 )
{
a_OutValue["Count"] = m_ItemCount;
a_OutValue["Health"] = m_ItemHealth;
a_OutValue["Health"] = m_ItemDamage;
}
}
void cItem::FromJson( const Json::Value & a_Value )
{
m_ItemID = (ENUM_ITEM_ID)a_Value.get("ID", -1 ).asInt();
if( m_ItemID > 0 )
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_ItemHealth = (short)a_Value.get("Health", -1 ).asInt();
m_ItemDamage = (short)a_Value.get("Health", -1 ).asInt();
}
}