Minor perf improvement in CScriptMaterialProxy

This commit is contained in:
samisalreadytaken 2021-12-26 18:33:53 +03:00
parent 6579e94305
commit 023512dcc3

View File

@ -252,10 +252,7 @@ CScriptMaterialProxy::CScriptMaterialProxy()
m_hScriptInstance = NULL; m_hScriptInstance = NULL;
m_hFuncOnBind = NULL; m_hFuncOnBind = NULL;
for (int i = 0; i < SCRIPT_MAT_PROXY_MAX_VARS; i++) V_memset( m_MaterialVars, 0, sizeof(m_MaterialVars) );
{
m_MaterialVars[i] = NULL;
}
} }
CScriptMaterialProxy::~CScriptMaterialProxy() CScriptMaterialProxy::~CScriptMaterialProxy()
@ -387,13 +384,10 @@ void CScriptMaterialProxy::OnBind( void *pRenderable )
if (!pEnt) 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 ); g_pScriptVM->SetValue( m_ScriptScope, "entity", SCRIPT_VARIANT_NULL );
} }
m_ScriptScope.Call( m_hFuncOnBind, NULL ); m_ScriptScope.Call( m_hFuncOnBind, NULL );
g_pScriptVM->ClearValue( m_ScriptScope, "entity" );
} }
else else
{ {