Fix typo & bind ItemType::isWritable

This commit is contained in:
Ahmed Samy 2013-12-27 11:32:19 +02:00
parent ab21558c47
commit a6f998d406
3 changed files with 5 additions and 2 deletions

View File

@ -82,6 +82,9 @@ void ItemType::unserialize(const BinaryTreePtr& node)
case ItemTypeAttrName:
setName(node->getString(len));
break;
case ItemTypeAttrWritable:
m_attribs.set(ItemTypeAttrWritable, true);
break;
default:
node->skip(len); // skip attribute
break;

View File

@ -148,8 +148,7 @@ public:
std::string getDesc() { return m_attribs.get<std::string>(ItemTypeAttrDesc); }
bool isNull() { return m_null; }
bool isWriteable() { return m_attribs.get<bool>(ItemTypeAttrWritable); }
bool isWritable() { return m_attribs.get<bool>(ItemTypeAttrWritable); }
private:
ItemCategory m_category;

View File

@ -451,6 +451,7 @@ void Client::registerLuaFunctions()
g_lua.registerClass<ItemType>();
g_lua.bindClassMemberFunction<ItemType>("getServerId", &ItemType::getServerId);
g_lua.bindClassMemberFunction<ItemType>("getClientId", &ItemType::getClientId);
g_lua.bindClassMemberFunction<ItemType>("isWritable", &ItemType::isWritable);
g_lua.registerClass<ThingType>();
g_lua.bindClassMemberFunction<ThingType>("getId", &ThingType::getId);