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

Fix configuration caching in log_deprecated (#9697)

* Fix configuration caching in log_deprecated

The configured variable was never set to true.
I've set the variables to thread_local because the configuration should be reloaded after reentering the world from mainmenu.
This commit is contained in:
HybridDog 2020-04-22 00:07:12 +02:00 committed by GitHub
parent 8ef239b448
commit 4361bfcb4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -157,9 +157,9 @@ static void script_log(lua_State *L, const std::string &message,
void log_deprecated(lua_State *L, const std::string &message, int stack_depth)
{
static bool configured = false;
static bool do_log = false;
static bool do_error = false;
static thread_local bool configured = false;
static thread_local bool do_log = false;
static thread_local bool do_error = false;
// Only read settings on first call
if (!configured) {
@ -167,9 +167,10 @@ void log_deprecated(lua_State *L, const std::string &message, int stack_depth)
if (value == "log") {
do_log = true;
} else if (value == "error") {
do_log = true;
do_log = true;
do_error = true;
}
configured = true;
}
if (do_log)