Integrating vscript interface code (based on Alien Swarm)

This commit is contained in:
James Mitchell
2020-05-04 16:25:15 +10:00
parent af85131deb
commit d840c57b4a
53 changed files with 5128 additions and 134 deletions

View File

@@ -18,6 +18,8 @@
#include "IEffects.h"
#include "props.h"
#include "point_template.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -114,6 +116,8 @@ END_DATADESC()
//-----------------------------------------------------------------------------
void CBaseNPCMaker::Spawn( void )
{
ScriptInstallPreSpawnHook();
SetSolid( SOLID_NONE );
m_nLiveChildren = 0;
Precache();
@@ -830,6 +834,12 @@ void CTemplateNPCMaker::MakeNPC( void )
pent->SetAbsAngles( angles );
}
if ( !ScriptPreInstanceSpawn( &m_ScriptScope, pEntity, m_iszTemplateData ) )
{
UTIL_RemoveImmediate( pEntity );
return;
}
m_OnSpawnNPC.Set( pEntity, pEntity, this );
if ( m_spawnflags & SF_NPCMAKER_FADE )
@@ -867,6 +877,8 @@ void CTemplateNPCMaker::MakeNPC( void )
SetUse( NULL );
}
}
ScriptPostSpawn( &m_ScriptScope, &pEntity, 1 );
}
//-----------------------------------------------------------------------------