File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -241,14 +241,19 @@ void MenuRenderer::PerformMenuAction(std::string button)
241241 CCommand tokenizedArgs;
242242 tokenizedArgs.Tokenize (cmd.c_str ());
243243
244- std::vector<std::string> cmdString = TokenizeCommand (cmd);
245- cmdString.erase (cmdString.begin ());
244+ std::string commandName = (tokenizedArgs[0 ] + 3 );
246245
247- std::string commandName = replace (tokenizedArgs[0 ], " sw_" , " " );
246+ std::vector<std::string> argsplit = TokenizeCommand (cmd.c_str ());
247+ argsplit.erase (argsplit.begin ());
248248
249- Command* cmd = g_commandsManager->FetchCommand (commandName);
250- if (cmd)
251- cmd->Execute (m_player->GetSlot ().Get (), cmdString, true , " sw_" );
249+ if (g_commandsManager->FetchCommand (commandName) == nullptr )
250+ return ;
251+
252+ Command* command = g_commandsManager->FetchCommand (commandName);
253+ if (!command)
254+ return ;
255+
256+ command->Execute (m_player->GetSlot ().Get (), argsplit, true , " sw_" );
252257 }
253258 else if (cmd != " " )
254259 m_player->PerformCommand (cmd);
You can’t perform that action at this time.
0 commit comments