mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-28 22:57:55 +03:00
Minor perf improvement in CScriptMaterialProxy
This commit is contained in:
parent
6579e94305
commit
023512dcc3
@ -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
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user