[Dvar]: Protect special dvar

This commit is contained in:
Diavolo 2022-12-26 21:24:46 +01:00
parent 4f58e4a7bc
commit fc7b109318
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5

View File

@ -321,7 +321,7 @@ namespace Components
{
if (AreArchiveDvarsProtected())
{
Logger::Print(Game::CON_CHANNEL_CONSOLEONLY, "Not allowing server to override saved dvar '{}'\n", dvarName);
Logger::Print(Game::CON_CHANNEL_CONSOLEONLY, "Not allowing server to override saved dvar '{}'\n", dvar->name);
return;
}
@ -331,6 +331,12 @@ namespace Components
SaveArchiveDvar(dvar);
}
if (dvar != nullptr && std::strcmp(dvar->name, "com_errorResolveCommand") == 0)
{
Logger::Print(Game::CON_CHANNEL_CONSOLEONLY, "Not allowing server to set '{}'\n", dvar->name);
return;
}
Utils::Hook::Call<void(const char*, const char*)>(0x4F52E0)(dvarName, value);
}