### pointed_thing
* `{type="nothing"}`
* `{type="node", under=pos, above=pos}`
-* `{type="object", ref=ObjectRef}`
+* `{type="object", id=ObjectID}`
Flag Specifier Format
---------------------
lua_pop(L, 1); // Pop value
}
-void push_pointed_thing(lua_State *L, const PointedThing &pointed)
+void push_pointed_thing(lua_State *L, const PointedThing &pointed, bool csm)
{
lua_newtable(L);
if (pointed.type == POINTEDTHING_NODE) {
} else if (pointed.type == POINTEDTHING_OBJECT) {
lua_pushstring(L, "object");
lua_setfield(L, -2, "type");
- push_objectRef(L, pointed.object_id);
- lua_setfield(L, -2, "ref");
+
+ if (csm) {
+ lua_pushinteger(L, pointed.object_id);
+ lua_setfield(L, -2, "id");
+ } else {
+ push_objectRef(L, pointed.object_id);
+ lua_setfield(L, -2, "ref");
+ }
} else {
lua_pushstring(L, "nothing");
lua_setfield(L, -2, "type");
void read_json_value (lua_State *L, Json::Value &root,
int index, u8 recursion = 0);
-void push_pointed_thing (lua_State *L, const PointedThing &pointed);
+void push_pointed_thing (lua_State *L, const PointedThing &pointed, bool csm = false);
void push_objectRef (lua_State *L, const u16 id);
lua_getfield(L, -1, "registered_on_placenode");
// Push data
- push_pointed_thing(L, pointed);
+ push_pointed_thing(L, pointed, true);
push_item_definition(L, item);
// Call functions
// Push data
LuaItemStack::create(L, item);
- push_pointed_thing(L, pointed);
+ push_pointed_thing(L, pointed, true);
// Call functions
runCallbacks(2, RUN_CALLBACKS_MODE_OR);