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.
This commit is contained in:
richard 2009-04-27 20:08:59 +02:00
parent c9724a09c7
commit 55876fe2ff
1 changed files with 4 additions and 7 deletions

View File

@ -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);