Skip to content

Commit

Permalink
Fix minor issue with log_deprecated()
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Dec 25, 2023
1 parent 094c433 commit 5405a55
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/script/common/c_internal.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5405a55

Please sign in to comment.