game: fix ent_create crash if entity model is NULL
This commit is contained in:
parent
99a4097df9
commit
357efab5c7
2 changed files with 8 additions and 0 deletions
|
@ -6560,6 +6560,12 @@ float CAI_BaseNPC::ThrowLimit( const Vector &vecStart,
|
|||
//-----------------------------------------------------------------------------
|
||||
void CAI_BaseNPC::SetupVPhysicsHull()
|
||||
{
|
||||
if( GetModelPtr() == NULL )
|
||||
{
|
||||
UTIL_Remove( this );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( GetMoveType() == MOVETYPE_VPHYSICS || GetMoveType() == MOVETYPE_NONE )
|
||||
return;
|
||||
|
||||
|
|
|
@ -5943,6 +5943,8 @@ const char *Studio_GetDefaultSurfaceProps( CStudioHdr *pstudiohdr )
|
|||
|
||||
float Studio_GetMass( CStudioHdr *pstudiohdr )
|
||||
{
|
||||
if( pstudiohdr == NULL ) return 0.f;
|
||||
|
||||
return pstudiohdr->mass();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue