mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-23 20:21:08 +03:00
Fix VScript not having "self" during precache, props not using death hook, VScript proxies not cleaning up correctly
This commit is contained in:
parent
66012e7c29
commit
b03ffdcac4
@ -272,6 +272,8 @@ void CScriptMaterialProxy::Release( void )
|
|||||||
m_hScriptInstance = NULL;
|
m_hScriptInstance = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_ScriptPersistableList.FindAndRemove( this );
|
||||||
|
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1338,6 +1338,12 @@ int CBreakableProp::OnTakeDamage( const CTakeDamageInfo &inputInfo )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CBreakableProp::Event_Killed( const CTakeDamageInfo &info )
|
void CBreakableProp::Event_Killed( const CTakeDamageInfo &info )
|
||||||
{
|
{
|
||||||
|
#ifdef MAPBASE_VSCRIPT
|
||||||
|
// False = Cheat death
|
||||||
|
if (ScriptDeathHook( const_cast<CTakeDamageInfo *>(&info) ) == false)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
IPhysicsObject *pPhysics = VPhysicsGetObject();
|
IPhysicsObject *pPhysics = VPhysicsGetObject();
|
||||||
if ( pPhysics && !pPhysics->IsMoveable() )
|
if ( pPhysics && !pPhysics->IsMoveable() )
|
||||||
{
|
{
|
||||||
|
@ -624,6 +624,9 @@ public:
|
|||||||
if ( g_pScriptVM->GetValue( STRING(pEnt->m_iszScriptId), &variant ) && variant.m_type == FIELD_HSCRIPT )
|
if ( g_pScriptVM->GetValue( STRING(pEnt->m_iszScriptId), &variant ) && variant.m_type == FIELD_HSCRIPT )
|
||||||
{
|
{
|
||||||
pEnt->m_ScriptScope.Init( variant.m_hScript, false );
|
pEnt->m_ScriptScope.Init( variant.m_hScript, false );
|
||||||
|
#ifdef MAPBASE_VSCRIPT
|
||||||
|
g_pScriptVM->SetValue( pEnt->m_ScriptScope, "self", pEnt->m_hScriptInstance );
|
||||||
|
#endif
|
||||||
#ifndef CLIENT_DLL
|
#ifndef CLIENT_DLL
|
||||||
pEnt->RunPrecacheScripts();
|
pEnt->RunPrecacheScripts();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user