Fix typo & bind ItemType::isWritable
This commit is contained in:
parent
ab21558c47
commit
a6f998d406
|
@ -82,6 +82,9 @@ void ItemType::unserialize(const BinaryTreePtr& node)
|
||||||
case ItemTypeAttrName:
|
case ItemTypeAttrName:
|
||||||
setName(node->getString(len));
|
setName(node->getString(len));
|
||||||
break;
|
break;
|
||||||
|
case ItemTypeAttrWritable:
|
||||||
|
m_attribs.set(ItemTypeAttrWritable, true);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
node->skip(len); // skip attribute
|
node->skip(len); // skip attribute
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -148,8 +148,7 @@ public:
|
||||||
std::string getDesc() { return m_attribs.get<std::string>(ItemTypeAttrDesc); }
|
std::string getDesc() { return m_attribs.get<std::string>(ItemTypeAttrDesc); }
|
||||||
|
|
||||||
bool isNull() { return m_null; }
|
bool isNull() { return m_null; }
|
||||||
|
bool isWritable() { return m_attribs.get<bool>(ItemTypeAttrWritable); }
|
||||||
bool isWriteable() { return m_attribs.get<bool>(ItemTypeAttrWritable); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ItemCategory m_category;
|
ItemCategory m_category;
|
||||||
|
|
|
@ -451,6 +451,7 @@ void Client::registerLuaFunctions()
|
||||||
g_lua.registerClass<ItemType>();
|
g_lua.registerClass<ItemType>();
|
||||||
g_lua.bindClassMemberFunction<ItemType>("getServerId", &ItemType::getServerId);
|
g_lua.bindClassMemberFunction<ItemType>("getServerId", &ItemType::getServerId);
|
||||||
g_lua.bindClassMemberFunction<ItemType>("getClientId", &ItemType::getClientId);
|
g_lua.bindClassMemberFunction<ItemType>("getClientId", &ItemType::getClientId);
|
||||||
|
g_lua.bindClassMemberFunction<ItemType>("isWritable", &ItemType::isWritable);
|
||||||
|
|
||||||
g_lua.registerClass<ThingType>();
|
g_lua.registerClass<ThingType>();
|
||||||
g_lua.bindClassMemberFunction<ThingType>("getId", &ThingType::getId);
|
g_lua.bindClassMemberFunction<ThingType>("getId", &ThingType::getId);
|
||||||
|
|
Loading…
Reference in New Issue