@@ -125,6 +125,7 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
125125
126126 // Grab the command
127127 tagCOMMANDENTRY* pEntry = Get (szCommand);
128+ bool wasHandled = false ;
128129 if (pEntry)
129130 {
130131 // If its a core command, or if its enabled
@@ -133,14 +134,16 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
133134 // Execute it
134135 if (!bIsScriptedBind || pEntry->bAllowScriptedBind )
135136 ExecuteHandler (pEntry->pfnCmdFunc , szParameters);
136- return true ;
137+
138+ wasHandled = true ;
137139 }
138140 }
139141
140142 // Recompose the original command text
141143 std::string val = std::string (szCommand) + " " + std::string (szParameters ? szParameters : " " );
142144
143145 // Is it a cvar? (syntax: cvar[ = value])
146+ if (!wasHandled)
144147 {
145148 // Check to see if '=' exists
146149 unsigned int nOpIndex = val.find (' =' );
@@ -188,7 +191,7 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
188191
189192 // HACK: if its a 'nick' command, save it here
190193 bool bIsNickCommand = !stricmp (szCommand, " nick" );
191- if (bIsNickCommand && szParameters && !bIsScriptedBind)
194+ if (!wasHandled && bIsNickCommand && szParameters && !bIsScriptedBind)
192195 {
193196 if (CCore::GetSingleton ().IsValidNick (szParameters))
194197 {
@@ -208,10 +211,14 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
208211 // Try to execute the handler
209212 if (m_pfnExecuteHandler)
210213 {
211- if (m_pfnExecuteHandler (szCommand, szParameters, bHandleRemotely, (pEntry != NULL ), bIsScriptedBind))
214+ bool bAllowScriptedBind = (!pEntry || pEntry->bAllowScriptedBind );
215+ if (m_pfnExecuteHandler (szCommand, szParameters, bHandleRemotely, wasHandled, bIsScriptedBind, bAllowScriptedBind))
212216 return true ;
213217 }
214218
219+ if (wasHandled)
220+ return true ;
221+
215222 // Unknown command
216223 val = _ (" Unknown command or cvar: " ) + szCommand;
217224 if (!bIsScriptedBind && !bIsNickCommand && pEntry == nullptr )
0 commit comments