[Command] Use std::format

This commit is contained in:
FutureRave 2021-11-12 19:26:19 +00:00
parent 7f61f3b994
commit 4e88f399eb
No known key found for this signature in database
GPG Key ID: E883E2BC9657D955

View File

@ -308,11 +308,8 @@ namespace command
{
if (!filename.empty())
{
//It's 10.2020 and still no std:format in vs :<
std::string line = dvar->name;
line.append("\"");
line.append(game::Dvar_ValueToString(dvar, dvar->current));
line.append("\"\r\n");
const auto line = std::format("{} \"{}\"\r\n", dvar->name,
game::Dvar_ValueToString(dvar, dvar->current));
utils::io::write_file(filename, line, i != 0);
}
console::info("%s \"%s\"\n", dvar->name,
@ -344,9 +341,7 @@ namespace command
{
if (!filename.empty())
{
//It's 10.2020 and still no std:format in vs :<
std::string line = cmd->name;
line.append("\r\n");
const auto line = std::format("{}\r\n", cmd->name);
utils::io::write_file(filename, line, i != 0);
}
console::info("%s\n", cmd->name);