From 2930621b7d77b03b17f2f6c54ed722d248c6d77a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 26 Aug 2007 20:12:30 +0000 Subject: [PATCH] fixed portion of amb777 -- chat triggers ate up spaces and thus "/ kick" was the same as "/kick" --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401383 --- core/ChatTriggers.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/core/ChatTriggers.cpp b/core/ChatTriggers.cpp index 708e397c..a5f2ace9 100644 --- a/core/ChatTriggers.cpp +++ b/core/ChatTriggers.cpp @@ -223,18 +223,6 @@ void ChatTriggers::OnSayCommand_Post() bool ChatTriggers::PreProcessTrigger(edict_t *pEdict, const char *args, bool is_quoted) { - /* Eat up whitespace */ - while (*args != '\0' && IsWhitespace(args)) - { - args++; - } - - /* Check if we're still valid */ - if (*args == '\0') - { - return false; - } - /* Extract a command. This is kind of sloppy. */ char cmd_buf[64]; size_t cmd_len = 0; @@ -248,6 +236,11 @@ bool ChatTriggers::PreProcessTrigger(edict_t *pEdict, const char *args, bool is_ } cmd_buf[cmd_len] = '\0'; + if (cmd_len == 0) + { + return false; + } + /* See if we have this registered */ bool prepended = false; if (!g_ConCmds.LookForSourceModCommand(cmd_buf))