aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_item.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api/l_item.h')
-rw-r--r--src/script/lua_api/l_item.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/script/lua_api/l_item.h b/src/script/lua_api/l_item.h
index a392555d2..72b1922dd 100644
--- a/src/script/lua_api/l_item.h
+++ b/src/script/lua_api/l_item.h
@@ -21,11 +21,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "lua_api/l_base.h"
#include "inventory.h" // ItemStack
+#include "util/pointer.h"
-class LuaItemStack : public ModApiBase {
+class LuaItemStack : public ModApiBase, public IntrusiveReferenceCounted {
private:
ItemStack m_stack;
+ LuaItemStack(const ItemStack &item);
+ ~LuaItemStack() = default;
+
static const char className[];
static const luaL_Reg methods[];
@@ -138,11 +142,10 @@ private:
static int l_peek_item(lua_State *L);
public:
- LuaItemStack(const ItemStack &item);
- ~LuaItemStack() = default;
+ DISABLE_CLASS_COPY(LuaItemStack)
- const ItemStack& getItem() const;
- ItemStack& getItem();
+ inline const ItemStack& getItem() const { return m_stack; }
+ inline ItemStack& getItem() { return m_stack; }
// LuaItemStack(itemstack or itemstring or table or nil)
// Creates an LuaItemStack and leaves it on top of stack