From 023512dcc3af13e7f55e0991480b51d1ab6646dd Mon Sep 17 00:00:00 2001 From: samisalreadytaken <46823719+samisalreadytaken@users.noreply.github.com> Date: Sun, 26 Dec 2021 18:33:53 +0300 Subject: [PATCH] Minor perf improvement in CScriptMaterialProxy --- sp/src/game/client/vscript_client.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sp/src/game/client/vscript_client.cpp b/sp/src/game/client/vscript_client.cpp index a01ba4d2..1b2891ab 100644 --- a/sp/src/game/client/vscript_client.cpp +++ b/sp/src/game/client/vscript_client.cpp @@ -252,10 +252,7 @@ CScriptMaterialProxy::CScriptMaterialProxy() m_hScriptInstance = NULL; m_hFuncOnBind = NULL; - for (int i = 0; i < SCRIPT_MAT_PROXY_MAX_VARS; i++) - { - m_MaterialVars[i] = NULL; - } + V_memset( m_MaterialVars, 0, sizeof(m_MaterialVars) ); } CScriptMaterialProxy::~CScriptMaterialProxy() @@ -387,13 +384,10 @@ void CScriptMaterialProxy::OnBind( void *pRenderable ) if (!pEnt) { - // Needs to register as a null value so the script doesn't break if it looks for an entity g_pScriptVM->SetValue( m_ScriptScope, "entity", SCRIPT_VARIANT_NULL ); } m_ScriptScope.Call( m_hFuncOnBind, NULL ); - - g_pScriptVM->ClearValue( m_ScriptScope, "entity" ); } else {