From f0a975b431d5fd8d9e7a286fce0ef99b82f9c8aa Mon Sep 17 00:00:00 2001 From: Greyscale Date: Thu, 7 May 2009 03:06:08 +0200 Subject: [PATCH] Fixed bug in ambience that disabled sound being added to download table if logging was disabled. --- src/zr/soundeffects/ambientsounds.inc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/zr/soundeffects/ambientsounds.inc b/src/zr/soundeffects/ambientsounds.inc index 61bb890..e76b17b 100644 --- a/src/zr/soundeffects/ambientsounds.inc +++ b/src/zr/soundeffects/ambientsounds.inc @@ -57,12 +57,6 @@ bool:AmbientSoundsValidateConfig() return false; } - // If logging is disabled for ambient sounds, then stop. - if (!LogCheckFlag(LOG_CORE_EVENTS, LOG_MODULE_AMBIENTSOUNDS)) - { - return false; - } - // Get ambient sound file. decl String:sound[SOUND_MAX_PATH]; GetConVarString(g_hCvarsList[CVAR_AMBIENTSOUNDS_FILE], sound, sizeof(sound)); @@ -72,7 +66,11 @@ bool:AmbientSoundsValidateConfig() if (!FileExists(sound, true)) { // Log invalid sound file error. - LogMessageFormatted(-1, "Ambient Sounds", "Config Validation", "Invalid sound file specified in zr_ambientsounds_file.", LOG_FORMAT_TYPE_ERROR); + if (LogCheckFlag(LOG_CORE_EVENTS, LOG_MODULE_AMBIENTSOUNDS)) + { + LogMessageFormatted(-1, "Ambient Sounds", "Config Validation", "Invalid sound file specified in zr_ambientsounds_file.", LOG_FORMAT_TYPE_ERROR); + } + return false; } @@ -81,7 +79,11 @@ bool:AmbientSoundsValidateConfig() if (ambientvolume <= 0.0) { // Log invalid ambient sound volume error. - LogMessageFormatted(-1, "Ambient Sounds", "Config Validation", "Ambient sound is either muted or invalid.", LOG_FORMAT_TYPE_ERROR); + if (LogCheckFlag(LOG_CORE_EVENTS, LOG_MODULE_AMBIENTSOUNDS)) + { + LogMessageFormatted(-1, "Ambient Sounds", "Config Validation", "Ambient sound is either muted or invalid.", LOG_FORMAT_TYPE_ERROR); + } + return false; } @@ -90,7 +92,11 @@ bool:AmbientSoundsValidateConfig() if (ambientlength <= 0.0) { // Log invalid ambient sound length error. - LogMessageFormatted(-1, "Ambient Sounds", "Config Validation", "Ambient sound length is invalid.", LOG_FORMAT_TYPE_ERROR); + if (LogCheckFlag(LOG_CORE_EVENTS, LOG_MODULE_AMBIENTSOUNDS)) + { + LogMessageFormatted(-1, "Ambient Sounds", "Config Validation", "Ambient sound length is invalid.", LOG_FORMAT_TYPE_ERROR); + } + return false; }