From 4e0d85534e5bee80caa5ea778b657fa99a6b353b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 5 Nov 2018 00:43:52 -0600 Subject: [PATCH] Fix issue where new log category settings were getting injected into the database with all settings turned on --- common/database.cpp | 7 +++---- common/eqemu_logsys.cpp | 9 +++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index a9496b6e3..8ff79a44c 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2080,7 +2080,6 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings) { auto results = QueryDatabase(query); int log_category_id = 0; - LogSys.file_logs_enabled = false; int categories_in_database[1000] = {}; @@ -2090,9 +2089,9 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings) { continue; } - log_settings[log_category_id].log_to_console = atoi(row[2]); - log_settings[log_category_id].log_to_file = atoi(row[3]); - log_settings[log_category_id].log_to_gmsay = atoi(row[4]); + log_settings[log_category_id].log_to_console = static_cast(atoi(row[2])); + log_settings[log_category_id].log_to_file = static_cast(atoi(row[3])); + log_settings[log_category_id].log_to_gmsay = static_cast(atoi(row[4])); /** * Determine if any output method is enabled for the category diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index f4d36e5d5..9e99e6cbe 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -113,6 +113,15 @@ void EQEmuLogSys::LoadLogSettingsDefaults() */ log_platform = GetExecutablePlatformInt(); + for (int log_category_id = Logs::AA; log_category_id != Logs::MaxCategoryID; log_category_id++) { + log_settings[log_category_id].log_to_console = 0; + log_settings[log_category_id].log_to_file = 0; + log_settings[log_category_id].log_to_gmsay = 0; + log_settings[log_category_id].is_category_enabled = 0; + } + + file_logs_enabled = false; + /** * Zero out Array */