Console fixes

This commit is contained in:
Federico Cecchetto 2022-02-26 16:10:29 +01:00
parent d7e1626240
commit a8fd70e31c

View File

@ -190,7 +190,7 @@ namespace game_console
for (const auto& dvar : dvars::dvar_list) for (const auto& dvar : dvars::dvar_list)
{ {
auto name = utils::string::to_lower(dvar); 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); 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.globals.y + con.globals.font_height, 1.0f, 1.0f, 0, color_white, 0,
con.cursor, '|'); 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 // check if using a prefixed '/' or not
const auto input = con.buffer[1] && (con.buffer[0] == '/' || con.buffer[0] == '\\') const auto input = con.buffer[1] && (con.buffer[0] == '/' || con.buffer[0] == '\\')
? std::string(con.buffer).substr(1) ? std::string(con.buffer).substr(1)