diff --git a/amxmodx/amxmodx.h b/amxmodx/amxmodx.h index 3a96630f..8592c9c3 100755 --- a/amxmodx/amxmodx.h +++ b/amxmodx/amxmodx.h @@ -329,7 +329,6 @@ extern int FF_PluginEnd; extern int FF_InconsistentFile; extern int FF_ClientAuthorized; extern int FF_ChangeLevel; -extern int FF_CvarChanged; extern bool g_coloredmenus; diff --git a/amxmodx/cvars.cpp b/amxmodx/cvars.cpp index 1d18dc04..3d7ea8c2 100644 --- a/amxmodx/cvars.cpp +++ b/amxmodx/cvars.cpp @@ -15,20 +15,13 @@ CvarManager g_CvarManager; DETOUR_DECL_STATIC2(Cvar_DirectSet, void, struct cvar_s*, var, const char*, value) { - static bool calledFromCallback = false; - - if (!calledFromCallback && var && value) + // Sanity checks against bogus pointers. + if (var && value) { + // Make sure old and new values are different to not trigger callbacks. if (strcmp(var->string, value) != 0) { - calledFromCallback = true; - - if (executeForwards(FF_CvarChanged, reinterpret_cast(var), var->string, value, var->name) > 0) - { - //return; - } - - calledFromCallback = false; + } } diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index 9908738f..fc4bc89d 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -142,7 +142,6 @@ int FF_PluginEnd = -1; int FF_InconsistentFile = -1; int FF_ClientAuthorized = -1; int FF_ChangeLevel = -1; -int FF_CvarChanged = -1; bool ColoredMenus(String & ModName) { @@ -503,7 +502,6 @@ int C_Spawn(edict_t *pent) FF_InconsistentFile = registerForward("inconsistent_file", ET_STOP, FP_CELL, FP_STRING, FP_STRINGEX, FP_DONE); FF_ClientAuthorized = registerForward("client_authorized", ET_IGNORE, FP_CELL, FP_DONE); FF_ChangeLevel = registerForward("server_changelevel", ET_STOP, FP_STRING, FP_DONE); - FF_CvarChanged = registerForward("OnCvarChanged", ET_STOP, FP_CELL, FP_STRING, FP_STRING, FP_STRING, FP_DONE); #if defined BINLOG_ENABLED if (!g_BinLog.Open()) diff --git a/amxmodx/msvc12/amxmodx_mm.vcxproj b/amxmodx/msvc12/amxmodx_mm.vcxproj index ca876873..b871d45f 100644 --- a/amxmodx/msvc12/amxmodx_mm.vcxproj +++ b/amxmodx/msvc12/amxmodx_mm.vcxproj @@ -421,6 +421,7 @@ + diff --git a/amxmodx/msvc12/amxmodx_mm.vcxproj.filters b/amxmodx/msvc12/amxmodx_mm.vcxproj.filters index adabf960..e0c0e65a 100644 --- a/amxmodx/msvc12/amxmodx_mm.vcxproj.filters +++ b/amxmodx/msvc12/amxmodx_mm.vcxproj.filters @@ -453,6 +453,9 @@ Pawn Includes + + Pawn Includes + diff --git a/plugins/include/cvars.inc b/plugins/include/cvars.inc index 21be38f3..3e8dcc62 100644 --- a/plugins/include/cvars.inc +++ b/plugins/include/cvars.inc @@ -19,5 +19,6 @@ * @param oldValue String containing the value of the cvar before it was changed * @param newValue String containing the new value of the cvar * @param cvarName String containing the name of the cvar + * + * public OnCvarChanged(cvarHandle, const oldValue[], const newValue[], const cvarName[]); */ -forward OnCvarChanged(cvarHandle, const oldValue[], const newValue[], const cvarName[]);