Enclose in dvar onInit signal

This commit is contained in:
FutureRave 2021-12-06 12:35:06 +00:00
parent 0e3d4a596b
commit 3af0871902
No known key found for this signature in database
GPG Key ID: E883E2BC9657D955

View File

@ -367,8 +367,12 @@ namespace Components
// Hook Dvar_SetFromStringByName inside CG_SetClientDvarFromServer so we can reset dvars when the player leaves the server
Utils::Hook(0x59386A, Dvar::DvarSetFromStringByNameStub, HOOK_CALL).install()->quick();
// If the game closed abruptly the dvars would have not been restored
Dvar::ResetDvarsValue();
// If the game closed abruptly, the dvars would not have been restored
Dvar::OnInit([]
{
Dvar::ResetDvarsValue();
});
}
Dvar::~Dvar()