mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-24 20:51:08 +03:00
Added model instance snatching for serverside ragdolls (retains decals)
This commit is contained in:
parent
8341a65a89
commit
f11d7e0be8
@ -487,6 +487,9 @@ int C_ServerRagdoll::InternalDrawModel( int flags )
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef MAPBASE
|
||||
static ConVar g_ragdoll_server_snatch_instance( "g_ragdoll_server_snatch_instance", "1", FCVAR_NONE, "Allows serverside ragdolls to snatch their source entities' model instances in the same way clientside ragdolls do, thereby retaining decals." );
|
||||
#endif
|
||||
|
||||
CStudioHdr *C_ServerRagdoll::OnNewModel( void )
|
||||
{
|
||||
@ -509,6 +512,26 @@ CStudioHdr *C_ServerRagdoll::OnNewModel( void )
|
||||
m_iv_ragAngles.SetMaxCount( m_elementCount );
|
||||
}
|
||||
|
||||
#ifdef MAPBASE
|
||||
if ( GetOwnerEntity() )
|
||||
{
|
||||
if (GetOwnerEntity()->GetModelName() == GetModelName())
|
||||
{
|
||||
// TODO: Is there a better place for this?
|
||||
if (GetOwnerEntity()->GetBaseAnimating())
|
||||
GetOwnerEntity()->GetBaseAnimating()->m_pServerRagdoll = this;
|
||||
|
||||
if (g_ragdoll_server_snatch_instance.GetBool())
|
||||
{
|
||||
GetOwnerEntity()->SnatchModelInstance( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add server ragdolls to the creation tick list
|
||||
NoteRagdollCreationTick( this );
|
||||
#endif
|
||||
|
||||
return hdr;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user