mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-27 22:27:57 +03:00
Implemented an OverrideMove VScript hook for NPCs
This commit is contained in:
parent
3431f21f4d
commit
0f3fd075c2
@ -10690,6 +10690,7 @@ Vector CAI_BaseNPC::GetActualShootPosition( const Vector &shootOrigin )
|
|||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
if (m_ScriptScope.IsInitialized() && g_Hook_GetActualShootPosition.CanRunInScope(m_ScriptScope))
|
if (m_ScriptScope.IsInitialized() && g_Hook_GetActualShootPosition.CanRunInScope(m_ScriptScope))
|
||||||
{
|
{
|
||||||
|
// shootOrigin, target
|
||||||
ScriptVariant_t functionReturn;
|
ScriptVariant_t functionReturn;
|
||||||
ScriptVariant_t args[] = { shootOrigin, ToHScript( GetEnemy() ) };
|
ScriptVariant_t args[] = { shootOrigin, ToHScript( GetEnemy() ) };
|
||||||
if (g_Hook_GetActualShootPosition.Call( m_ScriptScope, &functionReturn, args ))
|
if (g_Hook_GetActualShootPosition.Call( m_ScriptScope, &functionReturn, args ))
|
||||||
@ -13544,6 +13545,20 @@ bool CAI_BaseNPC::OverrideMoveFacing( const AILocalMoveGoal_t &move, float flInt
|
|||||||
|
|
||||||
bool CAI_BaseNPC::OverrideMove( float flInterval )
|
bool CAI_BaseNPC::OverrideMove( float flInterval )
|
||||||
{
|
{
|
||||||
|
#ifdef MAPBASE_VSCRIPT
|
||||||
|
if (m_ScriptScope.IsInitialized() && g_Hook_OverrideMove.CanRunInScope(m_ScriptScope))
|
||||||
|
{
|
||||||
|
// interval
|
||||||
|
ScriptVariant_t functionReturn;
|
||||||
|
ScriptVariant_t args[] = { flInterval };
|
||||||
|
if (g_Hook_OverrideMove.Call( m_ScriptScope, &functionReturn, args ))
|
||||||
|
{
|
||||||
|
if (functionReturn.m_type == FIELD_BOOLEAN)
|
||||||
|
return functionReturn.m_bool;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user