aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-01-02 16:26:40 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-01-02 16:26:40 +0200
commitab57fbe4caa5a8d74ec08c7a7f3d2cb04faf9de0 (patch)
treeaca3bacd26a6f6e1d16980b9b0169a9dfb44472e /src
parent56f55ab1af941c5a7c7a7aef4217189f9f2d1680 (diff)
downloadminetest-ab57fbe4caa5a8d74ec08c7a7f3d2cb04faf9de0.tar.gz
minetest-ab57fbe4caa5a8d74ec08c7a7f3d2cb04faf9de0.tar.bz2
minetest-ab57fbe4caa5a8d74ec08c7a7f3d2cb04faf9de0.zip
Add name field to registered entities
Diffstat (limited to 'src')
-rw-r--r--src/scriptapi.cpp4
1 files changed, 4 insertions, 0 deletions
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);