Show deprecation warnings ingame on the dev branch.

This commit is contained in:
Pentarctagon 2021-03-24 00:12:39 -05:00
parent 7c95e9d1a4
commit 7050eaf03e
No known key found for this signature in database
GPG Key ID: 9456BC54A21DBFA0

View File

@ -18,6 +18,7 @@
#include "log.hpp"
#include "preferences/general.hpp"
#include "game_version.hpp"
#include "utils/math.hpp"
// Set the default severity with the second parameter.
// -1 means the default is to never log on this domain.
@ -79,7 +80,8 @@ std::string deprecated_message(
const lg::logger& out_log = *log_ptr;
FORCE_LOG_TO(out_log, log_deprecate) << message << '\n';
if(preferences::get("show_deprecation", false)) {
// show deprecation warnings if enabled or if this is a development (odd numbered) release
if(preferences::get("show_deprecation", false) || is_odd(game_config::wesnoth_version.minor_version())) {
lg::wml_error() << message << '\n';
}
}