mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Integrating vscript interface code (based on Alien Swarm)
This commit is contained in:
@@ -1959,7 +1959,7 @@ extern "C" void Sys_Error( char *error, ... )
|
||||
// *mapData - pointer a block of entity map data
|
||||
// Output : -1 if the entity was not successfully created; 0 on success
|
||||
//-----------------------------------------------------------------------------
|
||||
int DispatchSpawn( CBaseEntity *pEntity )
|
||||
int DispatchSpawn( CBaseEntity *pEntity, bool bRunVScripts )
|
||||
{
|
||||
if ( pEntity )
|
||||
{
|
||||
@@ -1974,6 +1974,12 @@ int DispatchSpawn( CBaseEntity *pEntity )
|
||||
//pEntity->SetAbsMins( pEntity->GetOrigin() - Vector(1,1,1) );
|
||||
//pEntity->SetAbsMaxs( pEntity->GetOrigin() + Vector(1,1,1) );
|
||||
|
||||
if (bRunVScripts)
|
||||
{
|
||||
pEntity->RunVScripts();
|
||||
pEntity->RunPrecacheScripts();
|
||||
}
|
||||
|
||||
#if defined(TRACK_ENTITY_MEMORY) && defined(USE_MEM_DEBUG)
|
||||
const char *pszClassname = NULL;
|
||||
int iClassname = ((CEntityFactoryDictionary*)EntityFactoryDictionary())->m_Factories.Find( pEntity->GetClassname() );
|
||||
@@ -2040,6 +2046,11 @@ int DispatchSpawn( CBaseEntity *pEntity )
|
||||
}
|
||||
|
||||
gEntList.NotifySpawn( pEntity );
|
||||
|
||||
if( bRunVScripts )
|
||||
{
|
||||
pEntity->RunOnPostSpawnScripts();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user