Fixed a couple obscure crashes

This commit is contained in:
Blixibon 2021-04-23 22:54:20 -05:00
parent 2a24e9782c
commit 200001fdb9
2 changed files with 6 additions and 1 deletions

View File

@ -1626,6 +1626,11 @@ bool CNPC_MetroPolice::ShouldAttemptToStitch()
//-----------------------------------------------------------------------------
Vector CNPC_MetroPolice::StitchAimTarget( const Vector &posSrc, bool bNoisy )
{
#ifdef MAPBASE
if ( !GetEnemy() )
return vec3_origin;
#endif
// This will make us aim a stitch at the feet of the player so we can see it
if ( !GetEnemy()->IsPlayer() )
return GetShootTarget()->BodyTarget( posSrc, bNoisy );

View File

@ -1363,7 +1363,7 @@ CBaseAnimating *CreateServerRagdollSubmodel( CBaseAnimating *pOwner, const char
#ifdef MAPBASE_VSCRIPT
// Hook for pre-spawn ragdolling
if (pOwner->m_ScriptScope.IsInitialized() && CBaseAnimating::g_Hook_OnServerRagdoll.CanRunInScope( pOwner->m_ScriptScope ))
if (pOwner && pOwner->m_ScriptScope.IsInitialized() && CBaseAnimating::g_Hook_OnServerRagdoll.CanRunInScope( pOwner->m_ScriptScope ))
{
// ragdoll, submodel
ScriptVariant_t args[] = { ScriptVariant_t( pRagdoll->GetScriptInstance() ), true };