From 1a7d3d8188d3f484b6c3f0f05fd057d543a34725 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 18 Oct 2020 16:18:07 +0200 Subject: Extended ClientObjectRef; Improved CrystalPvP --- src/script/common/c_content.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/script/common/c_content.cpp') diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 9efa2c57f..7d4c1e748 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "object_properties.h" #include "collision.h" #include "cpp_api/s_node.h" +#include "lua_api/l_clientobject.h" #include "lua_api/l_object.h" #include "lua_api/l_item.h" #include "common/c_internal.h" @@ -1838,12 +1839,12 @@ void push_pointed_thing(lua_State *L, const PointedThing &pointed, bool csm, lua_setfield(L, -2, "type"); if (csm) { - lua_pushinteger(L, pointed.object_id); - lua_setfield(L, -2, "id"); + ClientObjectRef::create(L, pointed.object_id); } else { push_objectRef(L, pointed.object_id); - lua_setfield(L, -2, "ref"); } + + lua_setfield(L, -2, "ref"); } else { lua_pushstring(L, "nothing"); lua_setfield(L, -2, "type"); -- cgit v1.2.3