Merge pull request #673 from diamante0018/develop

[Dvar]: Protect special dvar
This commit is contained in:
Edo 2022-12-26 21:35:17 +01:00 committed by GitHub
commit 12a488a297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
}