diff --git a/src/client/component/game_console.cpp b/src/client/component/game_console.cpp index 913b412b..1e5ce400 100644 --- a/src/client/component/game_console.cpp +++ b/src/client/component/game_console.cpp @@ -673,13 +673,13 @@ namespace game_console return false; } - void find_matches(std::string input, std::vector& suggestions, const bool exact) + void find_matches(std::string input, std::vector& suggestions, const bool exact) { input = utils::string::to_lower(input); for (const auto& dvar : dvars::dvar_list) { - auto name = utils::string::to_lower(dvar); + auto name = utils::string::to_lower(dvar.name); if (game::Dvar_FindVar(name.data()) && match_compare(input, name, exact)) { suggestions.push_back(dvar); @@ -693,7 +693,7 @@ namespace game_console if (suggestions.size() == 0 && game::Dvar_FindVar(input.data())) { - suggestions.push_back(input.data()); + suggestions.push_back({ input.data(), "" }); } game::cmd_function_s* cmd = (*game::cmd_functions); @@ -703,9 +703,9 @@ namespace game_console { std::string name = utils::string::to_lower(cmd->name); - if (game_console::match_compare(input, name, exact)) + if (match_compare(input, name, exact)) { - suggestions.push_back(cmd->name); + suggestions.push_back({ cmd->name, "" }); } if (exact && suggestions.size() > 1) diff --git a/src/client/component/game_console.hpp b/src/client/component/game_console.hpp index e0b64753..0e5a1ca1 100644 --- a/src/client/component/game_console.hpp +++ b/src/client/component/game_console.hpp @@ -1,4 +1,5 @@ #pragma once +#include "game/dvars.hpp" namespace game_console { @@ -6,5 +7,5 @@ namespace game_console bool console_key_event(int local_client_num, int key, int down); bool match_compare(const std::string& input, const std::string& text, const bool exact); - void find_matches(std::string input, std::vector& suggestions, const bool exact); + void find_matches(std::string input, std::vector& suggestions, const bool exact); }