Console fixes

This commit is contained in:
Federico Cecchetto 2022-02-26 16:10:29 +01:00
parent 0c710269da
commit 3be9a00df9

View File

@ -190,7 +190,7 @@ namespace game_console
for (const auto& dvar : dvars::dvar_list)
{
auto name = utils::string::to_lower(dvar);
if (match_compare(input, name, exact))
if (game::Dvar_FindVar(name.data()) && match_compare(input, name, exact))
{
suggestions.push_back(dvar);
}
@ -245,9 +245,6 @@ namespace game_console
con.globals.y + con.globals.font_height, 1.0f, 1.0f, 0, color_white, 0,
con.cursor, '|');
game::R_AddCmdDrawText(con.buffer, 0x7FFF, console_font, con.globals.x,
con.globals.y + con.globals.font_height, 1.0f, 1.0f, 0.0f, color_white, 0);
// check if using a prefixed '/' or not
const auto input = con.buffer[1] && (con.buffer[0] == '/' || con.buffer[0] == '\\')
? std::string(con.buffer).substr(1)