1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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
This commit is contained in:
SmallJoker 2021-08-21 20:04:04 +02:00 committed by GitHub
parent a72d13064f
commit 0c1e9603db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 86 additions and 44 deletions

View file

@ -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);