diff --git a/src/backend/commands/player/toxic/send_squad.cpp b/src/backend/commands/player/toxic/send_squad.cpp index 386c1cd5..0a8a1af1 100644 --- a/src/backend/commands/player/toxic/send_squad.cpp +++ b/src/backend/commands/player/toxic/send_squad.cpp @@ -9,6 +9,13 @@ namespace big { using player_command::player_command; + std::string sterilized_name(std::string name) + { + string::operations::remove_whitespace(name); + string::operations::to_lower(name); + return name; + } + virtual std::optional> get_argument_suggestions(int arg) override { if (arg == 1) @@ -26,7 +33,7 @@ namespace big std::vector suggestions; for (auto& item : g_squad_spawner_service.m_templates) { - suggestions.push_back(item.m_name); + suggestions.push_back(sterilized_name(item.m_name)); } return suggestions; } @@ -58,7 +65,7 @@ namespace big int template_index = -1; for (int i = 0; i < g_squad_spawner_service.m_templates.size(); i++) { - if (g_squad_spawner_service.m_templates[i].m_name == args[1]) + if (sterilized_name(g_squad_spawner_service.m_templates[i].m_name) == args[1]) { template_index = i; break; diff --git a/src/views/core/view_cmd_executor.cpp b/src/views/core/view_cmd_executor.cpp index 2e3172de..f9a3c4d4 100644 --- a/src/views/core/view_cmd_executor.cpp +++ b/src/views/core/view_cmd_executor.cpp @@ -598,11 +598,13 @@ namespace big // set focus by default on input box ImGui::SetKeyboardFocusHere(0); - ImGui::SetNextItemWidth((screen_x * 0.5f) - 30.f); s_buffer = serialized_buffer(command_buffer); // Update serialized buffer every frame if (components::input_text_with_hint("", "CMD_EXECUTOR_TYPE_CMD"_T, command_buffer, ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory | ImGuiInputTextFlags_CallbackAlways, nullptr, input_callback)) { + if (!s_buffer.get_command_of_index(cursor_pos)) + return; + if (command::process(command_buffer, std::make_shared(), false)) { g.cmd_executor.enabled = false;