From ab57fbe4caa5a8d74ec08c7a7f3d2cb04faf9de0 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 2 Jan 2012 16:26:40 +0200 Subject: Add name field to registered entities --- src/scriptapi.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 401de8ade..dbbaf3dc9 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -2652,6 +2652,10 @@ static int l_register_entity(lua_State *L) // Get registered object to top of stack lua_pushvalue(L, 2); + + // Set name field + lua_pushvalue(L, 1); + lua_setfield(L, -2, "name"); // Set __index to point to itself lua_pushvalue(L, -1); -- cgit v1.2.3