mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Implement CScriptHookManager
This commit is contained in:
@@ -154,7 +154,7 @@ public:
|
||||
|
||||
void OnEntityCreated( CBaseEntity *pEntity )
|
||||
{
|
||||
if ( g_pScriptVM )
|
||||
if ( g_pScriptVM && GetScriptHookManager().IsEventHooked( "OnEntityCreated" ) )
|
||||
{
|
||||
// entity
|
||||
ScriptVariant_t args[] = { ScriptVariant_t( pEntity->GetScriptInstance() ) };
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
|
||||
void OnEntitySpawned( CBaseEntity *pEntity )
|
||||
{
|
||||
if ( g_pScriptVM )
|
||||
if ( g_pScriptVM && GetScriptHookManager().IsEventHooked( "OnEntitySpawned" ) )
|
||||
{
|
||||
// entity
|
||||
ScriptVariant_t args[] = { ScriptVariant_t( pEntity->GetScriptInstance() ) };
|
||||
@@ -174,7 +174,7 @@ public:
|
||||
|
||||
void OnEntityDeleted( CBaseEntity *pEntity )
|
||||
{
|
||||
if ( g_pScriptVM )
|
||||
if ( g_pScriptVM && GetScriptHookManager().IsEventHooked( "OnEntityDeleted" ) )
|
||||
{
|
||||
// entity
|
||||
ScriptVariant_t args[] = { ScriptVariant_t( pEntity->GetScriptInstance() ) };
|
||||
@@ -600,6 +600,10 @@ bool VScriptServerInit()
|
||||
Log( "VSCRIPT: Started VScript virtual machine using script language '%s'\n", g_pScriptVM->GetLanguageName() );
|
||||
#endif
|
||||
|
||||
#ifdef MAPBASE_VSCRIPT
|
||||
GetScriptHookManager().OnInit();
|
||||
#endif
|
||||
|
||||
#ifdef MAPBASE_VSCRIPT
|
||||
// MULTIPLAYER
|
||||
// ScriptRegisterFunctionNamed( g_pScriptVM, UTIL_PlayerByIndex, "GetPlayerByIndex", "PlayerInstanceFromIndex" );
|
||||
@@ -836,6 +840,8 @@ public:
|
||||
{
|
||||
#ifdef MAPBASE_VSCRIPT
|
||||
g_ScriptNetMsg->LevelShutdownPreVM();
|
||||
|
||||
GetScriptHookManager().OnShutdown();
|
||||
#endif
|
||||
VScriptServerTerm();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user