- if (L) {
- if (do_error)
- script_error(L, LUA_ERRRUN, NULL, NULL);
- else
- infostream << script_get_backtrace(L) << std::endl;
- }
- }
+void log_deprecated(lua_State *L, std::string message, int stack_depth)
+{
+ DeprecatedHandlingMode mode = get_deprecated_handling_mode();
+ if (mode == DeprecatedHandlingMode::Ignore)
+ return;
+
+ script_log_add_source(L, message, stack_depth);
+ warningstream << message << std::endl;
+
+ if (mode == DeprecatedHandlingMode::Error)
+ script_error(L, LUA_ERRRUN, NULL, NULL);
+ else
+ infostream << script_get_backtrace(L) << std::endl;