summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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);