Skip to content

Added the ability to add callbacks to ConVar that will be called when ConVar is changed. #421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Changed ConVarExt::ClearCallback.
  • Loading branch information
CookStar committed Oct 3, 2021
commit 3f0734591468fbfbdb8e51059e4e3b97f6f4358c
5 changes: 4 additions & 1 deletion src/core/modules/cvars/cvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,12 @@ void ConVarExt::RemoveChangedCallback(ConVar* pConVar, PyObject* pCallable)

void ConVarExt::ClearCallback()
{
g_ConVarMap.clear();
if (installed)
{
g_ConVarMap.clear();
g_pCVar->RemoveGlobalChangeCallback(ChangedCallback);
installed = false;
}
}

bool ConVarExt::installed = false;