From 06b9b09ea6b82db1eb42b84a3b8431a17063648e Mon Sep 17 00:00:00 2001
From: Scott Ehlert <ds@alliedmods.net>
Date: Wed, 14 Feb 2007 23:44:40 +0000
Subject: [PATCH] Plugin forwards for convar changes are no longer called if
 the new and old values are the same

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40500
---
 core/CConVarManager.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/core/CConVarManager.cpp b/core/CConVarManager.cpp
index d4de4ea0..32128386 100644
--- a/core/CConVarManager.cpp
+++ b/core/CConVarManager.cpp
@@ -372,6 +372,13 @@ void CConVarManager::UnhookConVarChange(IPluginContext *pContext, ConVar *cvar,
 
 void CConVarManager::OnConVarChanged(ConVar *cvar, const char *oldValue)
 {
+	// If the values are the same...
+	if (strcmp(cvar->GetString(), oldValue) == 0)
+	{
+		// Exit early in order to not trigger callbacks
+		return;
+	}
+
 	Trie *cache = g_ConVarManager.GetConVarCache();
 	ConVarInfo *info;