From 0c1e9603db32b4281974fdd8b8e3b505148be47e Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sat, 21 Aug 2021 20:04:04 +0200 Subject: HUD: Reject and warn on invalid stat types (#11548) This comes into play on older servers which do not know the "stat" type. Warnings are only logged once to avoid spam within globalstep callbacks --- src/script/common/c_internal.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/script/common/c_internal.h') diff --git a/src/script/common/c_internal.h b/src/script/common/c_internal.h index 452c2dd5e..4ddbed232 100644 --- a/src/script/common/c_internal.h +++ b/src/script/common/c_internal.h @@ -114,6 +114,9 @@ void script_error(lua_State *L, int pcall_result, const char *mod, const char *f void script_run_callbacks_f(lua_State *L, int nargs, RunCallbacksMode mode, const char *fxn); +bool script_log_unique(lua_State *L, std::string message, std::ostream &log_to, + int stack_depth = 1); + enum class DeprecatedHandlingMode { Ignore, Log, @@ -134,5 +137,4 @@ DeprecatedHandlingMode get_deprecated_handling_mode(); * @param message The deprecation method * @param stack_depth How far on the stack to the first user function (ie: not builtin or core) */ -void log_deprecated(lua_State *L, const std::string &message, - int stack_depth=1); +void log_deprecated(lua_State *L, std::string message, int stack_depth = 1); -- cgit v1.2.3