CSM: Fix crashing minetest.get_item_def()
authorsfan5 <sfan5@live.de>
Wed, 20 May 2020 18:13:16 +0000 (20:13 +0200)
committersfan5 <sfan5@live.de>
Wed, 20 May 2020 18:15:09 +0000 (20:15 +0200)
fixes #9884

src/script/common/c_content.cpp

index 116a59c0945a80c1c01af5f60aa889c4b9c6eeb9..2157d087d562e1e4e80d16fe31c0b95b8add30a2 100644 (file)
@@ -164,7 +164,7 @@ void push_item_definition_full(lua_State *L, const ItemDefinition &i)
        lua_setfield(L, -2, "usable");
        lua_pushboolean(L, i.liquids_pointable);
        lua_setfield(L, -2, "liquids_pointable");
-       if (i.type == ITEM_TOOL) {
+       if (i.tool_capabilities) {
                push_tool_capabilities(L, *i.tool_capabilities);
                lua_setfield(L, -2, "tool_capabilities");
        }