From 55876fe2ff9c672ef3934bd0f80087c22a7121a1 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 27 Apr 2009 20:08:59 +0200 Subject: [PATCH] Fixed LogMessageFormatted ignoring unspecified clients (-1) when ignore console is enabled. Simplified logic. When ignoring console the match must be explicit (client 0), not just any non-valid player. Unspecified clients (-1) are used on core events, but they were wrongfully ignored. Clients are only specified on player events or console events. Simplified logig: Instead of checking what something isn't, check what it's required to be. Inverted logic may be confusing. --- src/zr/log.inc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/zr/log.inc b/src/zr/log.inc index bcd8e80..d619ed5 100644 --- a/src/zr/log.inc +++ b/src/zr/log.inc @@ -100,11 +100,8 @@ LogMessageFormatted(client, const String:module[], const String:block[], const S decl String:logtext[LOG_MAX_LENGTH_FILE]; - // Set to true if log to console, false if client. - new bool:console = !ZRIsClientValid(client); - - // If client is invalid (console), and console is ignored, then stop. - if (console && LogCheckFlag(LOG_IGNORE_CONSOLE)) + // If client is invalid (console), and console log events are ignored, then stop. + if (client == 0 && LogCheckFlag(LOG_IGNORE_CONSOLE)) { return; } @@ -141,8 +138,8 @@ LogMessageFormatted(client, const String:module[], const String:block[], const S LogToAdmins(logtext); } - // If client isn't console, and we log to client's then continue. - if (!console && LogCheckFlag(LOG_TO_CLIENT)) + // If client is a valid client (but not console), and we log to client's then continue. + if (ZRIsClientValid(client) && LogCheckFlag(LOG_TO_CLIENT)) { // Set client as translation target. SetGlobalTransTarget(client);