Skip to content

Commit

Permalink
Update luascript.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Emil Bergström committed Sep 22, 2021
1 parent 7b1def5 commit 95355b7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/luascript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,7 @@ void LuaScriptInterface::registerFunctions()
registerMethod("ItemType", "isMagicField", LuaScriptInterface::luaItemTypeIsMagicField);
registerMethod("ItemType", "isUseable", LuaScriptInterface::luaItemTypeIsUseable);
registerMethod("ItemType", "isPickupable", LuaScriptInterface::luaItemTypeIsPickupable);
registerMethod("ItemType", "isKey", LuaScriptInterface::luaItemTypeIsKey);

registerMethod("ItemType", "getType", LuaScriptInterface::luaItemTypeGetType);
registerMethod("ItemType", "getGroup", LuaScriptInterface::luaItemTypeGetGroup);
Expand Down Expand Up @@ -11899,6 +11900,18 @@ int LuaScriptInterface::luaItemTypeIsPickupable(lua_State* L)
return 1;
}

int LuaScriptInterface::luaItemTypeIsKey(lua_State* L)
{
// itemType:isKey()
const ItemType* itemType = getUserdata<const ItemType>(L, 1);
if (itemType) {
pushBoolean(L, itemType->isKey());
} else {
lua_pushnil(L);
}
return 1;
}

int LuaScriptInterface::luaItemTypeGetType(lua_State* L)
{
// itemType:getType()
Expand Down

0 comments on commit 95355b7

Please sign in to comment.