mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-26 06:45:31 +03:00
Fixed activator, caller, etc. values not working within RunScriptCode and related inputs
This commit is contained in:
parent
bb2478f342
commit
e4d5d946d2
@ -4674,6 +4674,11 @@ bool CBaseEntity::AcceptInput( const char *szInputName, CBaseEntity *pActivator,
|
||||
{
|
||||
(this->*pfnInput)( data );
|
||||
}
|
||||
|
||||
if ( m_ScriptScope.IsInitialized() )
|
||||
{
|
||||
ScriptInputHookClearParams();
|
||||
}
|
||||
}
|
||||
else if ( dmap->dataDesc[i].flags & FTYPEDESC_KEY )
|
||||
{
|
||||
@ -4707,6 +4712,8 @@ bool CBaseEntity::AcceptInput( const char *szInputName, CBaseEntity *pActivator,
|
||||
if (functionReturn.m_bool)
|
||||
return true;
|
||||
}
|
||||
|
||||
ScriptInputHookClearParams();
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -4750,13 +4757,19 @@ bool CBaseEntity::ScriptInputHook( const char *szInputName, CBaseEntity *pActiva
|
||||
bHandled = true;
|
||||
}
|
||||
|
||||
return bHandled;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBaseEntity::ScriptInputHookClearParams()
|
||||
{
|
||||
g_pScriptVM->ClearValue( "activator" );
|
||||
g_pScriptVM->ClearValue( "caller" );
|
||||
#ifdef MAPBASE_VSCRIPT
|
||||
g_pScriptVM->ClearValue( "parameter" );
|
||||
#endif
|
||||
|
||||
return bHandled;
|
||||
}
|
||||
|
||||
#ifdef MAPBASE_VSCRIPT
|
||||
|
@ -693,6 +693,7 @@ public:
|
||||
#endif
|
||||
|
||||
bool ScriptInputHook( const char *szInputName, CBaseEntity *pActivator, CBaseEntity *pCaller, variant_t Value, ScriptVariant_t &functionReturn );
|
||||
void ScriptInputHookClearParams();
|
||||
#ifdef MAPBASE_VSCRIPT
|
||||
bool ScriptDeathHook( CTakeDamageInfo *info );
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user