diff --git a/sp/src/game/client/mapbase/vscript_vgui.cpp b/sp/src/game/client/mapbase/vscript_vgui.cpp index 815679e0..805d3305 100644 --- a/sp/src/game/client/mapbase/vscript_vgui.cpp +++ b/sp/src/game/client/mapbase/vscript_vgui.cpp @@ -1477,6 +1477,11 @@ public: { ivgui()->AddTickSignal( this->GetVPanel(), i ); } + + void RemoveTickSignal() + { + ivgui()->RemoveTickSignal( this->GetVPanel() ); + } #if SCRIPT_VGUI_SIGNAL_INTERFACE void AddActionSignalTarget( HSCRIPT messageTarget ) { @@ -1867,6 +1872,7 @@ public: DEFINE_SCRIPTFUNC( MakeReadyForUse, "" )\ DEFINE_SCRIPTFUNC( GetName, "" )\ DEFINE_SCRIPTFUNC( AddTickSignal, "" )\ + DEFINE_SCRIPTFUNC( RemoveTickSignal, "" )\ \ DEFINE_SCRIPTFUNC( GetParent, "" )\ DEFINE_SCRIPTFUNC( SetParent, "" )\ diff --git a/sp/src/game/server/ai_basenpc.cpp b/sp/src/game/server/ai_basenpc.cpp index acfebf14..f3c1ee28 100644 --- a/sp/src/game/server/ai_basenpc.cpp +++ b/sp/src/game/server/ai_basenpc.cpp @@ -12333,6 +12333,7 @@ BEGIN_ENT_SCRIPTDESC( CAI_BaseNPC, CBaseCombatCharacter, "The base class all NPC DEFINE_SCRIPTFUNC( IsCommandable, "Check if the NPC is commandable." ) DEFINE_SCRIPTFUNC( IsInPlayerSquad, "Check if the NPC is in the player's squad." ) + DEFINE_SCRIPTFUNC( IsMedic, "Returns true if this NPC is a medic." ) DEFINE_SCRIPTFUNC_NAMED( VScriptGetCine, "GetCine", "Get the NPC's currently running scripted sequence if it has one." ) DEFINE_SCRIPTFUNC( GetScriptState, "Get the NPC's current scripted sequence state." ) diff --git a/sp/src/game/server/baseentity.cpp b/sp/src/game/server/baseentity.cpp index d8c4b63e..9df5cc09 100644 --- a/sp/src/game/server/baseentity.cpp +++ b/sp/src/game/server/baseentity.cpp @@ -10300,8 +10300,9 @@ bool CBaseEntity::ScriptAddOutput( const char *pszOutputName, const char *pszTar const char *CBaseEntity::ScriptGetKeyValue( const char *pszKeyName ) { static char szValue[128]; - GetKeyValue( pszKeyName, szValue, sizeof(szValue) ); - return szValue; + if ( GetKeyValue( pszKeyName, szValue, sizeof(szValue) ) ) + return szValue; + return NULL; } //----------------------------------------------------------------------------- diff --git a/sp/src/game/server/hl2/npc_citizen17.cpp b/sp/src/game/server/hl2/npc_citizen17.cpp index be80179a..02baaf07 100644 --- a/sp/src/game/server/hl2/npc_citizen17.cpp +++ b/sp/src/game/server/hl2/npc_citizen17.cpp @@ -412,7 +412,6 @@ ScriptHook_t CNPC_Citizen::g_Hook_SelectModel; BEGIN_ENT_SCRIPTDESC( CNPC_Citizen, CAI_BaseActor, "npc_citizen from Half-Life 2" ) - DEFINE_SCRIPTFUNC( IsMedic, "Returns true if this citizen is a medic." ) DEFINE_SCRIPTFUNC( IsAmmoResupplier, "Returns true if this citizen is an ammo resupplier." ) DEFINE_SCRIPTFUNC( CanHeal, "Returns true if this citizen is a medic or ammo resupplier currently able to heal/give ammo." ) diff --git a/sp/src/vscript/vscript_squirrel.nut b/sp/src/vscript/vscript_squirrel.nut index 5b76bbe3..54492423 100644 --- a/sp/src/vscript/vscript_squirrel.nut +++ b/sp/src/vscript/vscript_squirrel.nut @@ -118,15 +118,14 @@ class CSimpleCallChainer function PostScriptExecute() { - local func; - try { - func = scope[prefix]; - } catch(e) { - return; + if ( prefix in scope ) + { + local func = scope[prefix]; + if ( typeof func == "function" ) + { + chain.push(func); + } } - if (typeof(func) != "function") - return; - chain.push(func); } function Call() @@ -569,4 +568,4 @@ if (developer) __Documentation.RegisterHelp( "Lerp", "float Lerp(float, float, float)", "" ); __Documentation.RegisterHelp( "SimpleSpline", "float SimpleSpline(float)", "" ); } -)vscript"; \ No newline at end of file +)vscript";