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())