From e2726757f7bcde10cb5b4d5bf7ba69f0a1f01101 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Fri, 23 Jun 2023 20:29:12 +1200 Subject: [PATCH] Log the name of entities that can't be added (cherry picked from commit 2422c202d38a798f1162fb6aea79e53ed061117d) --- src/script/lua_api/l_env.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 68aec1b53..94d8f107f 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -641,8 +641,11 @@ int ModApiEnvMod::l_add_entity(lua_State *L) ServerActiveObject *obj = new LuaEntitySAO(env, pos, name, staticdata); int objectid = env->addActiveObject(obj); // If failed to add, return nothing (reads as nil) - if(objectid == 0) + if(objectid == 0) { + errorstream << "Failed to add entity " << name << " at " << PP(pos) + << std::endl; return 0; + } // If already deleted (can happen in on_activate), return nil if (obj->isGone())