mirror of
https://github.com/nillerusr/source-engine.git
synced 2024-12-22 14:16:50 +00:00
game: fix ent_create crash if entity model is NULL
This commit is contained in:
parent
1aa326b7f2
commit
0f7d9d029f
@ -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 New Issue
Block a user