From 5405a558fd1bd76c4d04aa409c43ef31e3f39640 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 25 Dec 2023 19:47:34 +0100 Subject: [PATCH] Fix minor issue with log_deprecated() --- src/script/common/c_internal.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/script/common/c_internal.cpp b/src/script/common/c_internal.cpp index 1ca9f3767..b80ee6e40 100644 --- a/src/script/common/c_internal.cpp +++ b/src/script/common/c_internal.cpp @@ -180,16 +180,17 @@ void log_deprecated(lua_State *L, std::string message, int stack_depth, bool onc if (mode == DeprecatedHandlingMode::Ignore) return; + bool log = true; if (once) { - script_log_unique(L, message, warningstream, stack_depth); + log = script_log_unique(L, message, warningstream, stack_depth); } else { script_log_add_source(L, message, stack_depth); warningstream << message << std::endl; } if (mode == DeprecatedHandlingMode::Error) - script_error(L, LUA_ERRRUN, NULL, NULL); - else + script_error(L, LUA_ERRRUN, nullptr, nullptr); + else if (log) infostream << script_get_backtrace(L) << std::endl; }