From aca747e5d9bbb9105fd8675ad5baed7c4485698c Mon Sep 17 00:00:00 2001 From: m Date: Sun, 13 Mar 2022 07:59:35 -0500 Subject: [PATCH] small fix --- src/client/component/game_console.cpp | 10 +++++----- src/client/component/game_console.hpp | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) 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); }