mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-24 04:31:11 +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;
|
||||
}
|
||||
|
||||
g_ScriptPersistableList.FindAndRemove( this );
|
||||
|
||||
delete this;
|
||||
}
|
||||
|
||||
|
@ -1338,6 +1338,12 @@ int CBreakableProp::OnTakeDamage( const CTakeDamageInfo &inputInfo )
|
||||
//-----------------------------------------------------------------------------
|
||||
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();
|
||||
if ( pPhysics && !pPhysics->IsMoveable() )
|
||||
{
|
||||
|
@ -624,6 +624,9 @@ public:
|
||||
if ( g_pScriptVM->GetValue( STRING(pEnt->m_iszScriptId), &variant ) && variant.m_type == FIELD_HSCRIPT )
|
||||
{
|
||||
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
|
||||
pEnt->RunPrecacheScripts();
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user