@@ -125,7 +125,6 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
125125
126126 // Grab the command
127127 tagCOMMANDENTRY* pEntry = Get (szCommand);
128- bool wasHandled = false ;
129128 if (pEntry)
130129 {
131130 // If its a core command, or if its enabled
@@ -134,16 +133,14 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
134133 // Execute it
135134 if (!bIsScriptedBind || pEntry->bAllowScriptedBind )
136135 ExecuteHandler (pEntry->pfnCmdFunc , szParameters);
137-
138- wasHandled = true ;
136+ return true ;
139137 }
140138 }
141139
142140 // Recompose the original command text
143141 std::string val = std::string (szCommand) + " " + std::string (szParameters ? szParameters : " " );
144142
145143 // Is it a cvar? (syntax: cvar[ = value])
146- if (!wasHandled)
147144 {
148145 // Check to see if '=' exists
149146 unsigned int nOpIndex = val.find (' =' );
@@ -191,7 +188,7 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
191188
192189 // HACK: if its a 'nick' command, save it here
193190 bool bIsNickCommand = !stricmp (szCommand, " nick" );
194- if (!wasHandled && bIsNickCommand && szParameters && !bIsScriptedBind)
191+ if (bIsNickCommand && szParameters && !bIsScriptedBind)
195192 {
196193 if (CCore::GetSingleton ().IsValidNick (szParameters))
197194 {
@@ -211,14 +208,10 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
211208 // Try to execute the handler
212209 if (m_pfnExecuteHandler)
213210 {
214- bool bAllowScriptedBind = (!pEntry || pEntry->bAllowScriptedBind );
215- if (m_pfnExecuteHandler (szCommand, szParameters, bHandleRemotely, wasHandled, bIsScriptedBind, bAllowScriptedBind))
211+ if (m_pfnExecuteHandler (szCommand, szParameters, bHandleRemotely, (pEntry != NULL ), bIsScriptedBind))
216212 return true ;
217213 }
218214
219- if (wasHandled)
220- return true ;
221-
222215 // Unknown command
223216 val = _ (" Unknown command or cvar: " ) + szCommand;
224217 if (!bIsScriptedBind && !bIsNickCommand && pEntry == nullptr )
0 commit comments