@@ -125,6 +125,7 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
125
125
126
126
// Grab the command
127
127
tagCOMMANDENTRY* pEntry = Get (szCommand);
128
+ bool wasHandled = false ;
128
129
if (pEntry)
129
130
{
130
131
// If its a core command, or if its enabled
@@ -133,13 +134,16 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
133
134
// Execute it
134
135
if (!bIsScriptedBind || pEntry->bAllowScriptedBind )
135
136
ExecuteHandler (pEntry->pfnCmdFunc , szParameters);
137
+
138
+ wasHandled = true ;
136
139
}
137
140
}
138
141
139
142
// Recompose the original command text
140
143
std::string val = std::string (szCommand) + " " + std::string (szParameters ? szParameters : " " );
141
144
142
145
// Is it a cvar? (syntax: cvar[ = value])
146
+ if (!wasHandled)
143
147
{
144
148
// Check to see if '=' exists
145
149
unsigned int nOpIndex = val.find (' =' );
@@ -187,7 +191,7 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
187
191
188
192
// HACK: if its a 'nick' command, save it here
189
193
bool bIsNickCommand = !stricmp (szCommand, " nick" );
190
- if (bIsNickCommand && szParameters && !bIsScriptedBind)
194
+ if (!wasHandled && bIsNickCommand && szParameters && !bIsScriptedBind)
191
195
{
192
196
if (CCore::GetSingleton ().IsValidNick (szParameters))
193
197
{
@@ -208,10 +212,13 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
208
212
if (m_pfnExecuteHandler)
209
213
{
210
214
bool bAllowScriptedBind = (!pEntry || pEntry->bAllowScriptedBind );
211
- if (m_pfnExecuteHandler (szCommand, szParameters, bHandleRemotely, (pEntry != NULL ) , bIsScriptedBind, bAllowScriptedBind))
215
+ if (m_pfnExecuteHandler (szCommand, szParameters, bHandleRemotely, wasHandled , bIsScriptedBind, bAllowScriptedBind))
212
216
return true ;
213
217
}
214
218
219
+ if (wasHandled)
220
+ return true ;
221
+
215
222
// Unknown command
216
223
val = _ (" Unknown command or cvar: " ) + szCommand;
217
224
if (!bIsScriptedBind && !bIsNickCommand && pEntry == nullptr )
0 commit comments