mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-27 22:27:57 +03:00
Fix "Fade Corpse" spawnflag on NPCs not applying to serverside ragdolls
This commit is contained in:
parent
bdc34e4bad
commit
4efb50283d
@ -1610,6 +1610,15 @@ void CBaseCombatCharacter::FixupBurningServerRagdoll( CBaseEntity *pRagdoll )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool CBaseCombatCharacter::ShouldFadeServerRagdolls() const
|
||||||
|
{
|
||||||
|
#ifdef MAPBASE
|
||||||
|
return IsNPC() ? HasSpawnFlags( SF_NPC_FADE_CORPSE ) : true;
|
||||||
|
#else
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool CBaseCombatCharacter::BecomeRagdollBoogie( CBaseEntity *pKiller, const Vector &forceVector, float duration, int flags )
|
bool CBaseCombatCharacter::BecomeRagdollBoogie( CBaseEntity *pKiller, const Vector &forceVector, float duration, int flags )
|
||||||
{
|
{
|
||||||
Assert( CanBecomeRagdoll() );
|
Assert( CanBecomeRagdoll() );
|
||||||
@ -1618,7 +1627,7 @@ bool CBaseCombatCharacter::BecomeRagdollBoogie( CBaseEntity *pKiller, const Vect
|
|||||||
|
|
||||||
info.SetDamageForce( forceVector );
|
info.SetDamageForce( forceVector );
|
||||||
|
|
||||||
CBaseEntity *pRagdoll = CreateServerRagdoll( this, 0, info, COLLISION_GROUP_INTERACTIVE_DEBRIS, true );
|
CBaseEntity *pRagdoll = CreateServerRagdoll( this, 0, info, COLLISION_GROUP_INTERACTIVE_DEBRIS, ShouldFadeServerRagdolls() );
|
||||||
|
|
||||||
pRagdoll->SetCollisionBounds( CollisionProp()->OBBMins(), CollisionProp()->OBBMaxs() );
|
pRagdoll->SetCollisionBounds( CollisionProp()->OBBMins(), CollisionProp()->OBBMaxs() );
|
||||||
|
|
||||||
@ -1641,7 +1650,7 @@ CBaseEntity *CBaseCombatCharacter::BecomeRagdollBoogie( CBaseEntity *pKiller, co
|
|||||||
|
|
||||||
info.SetDamageForce( forceVector );
|
info.SetDamageForce( forceVector );
|
||||||
|
|
||||||
CBaseEntity *pRagdoll = CreateServerRagdoll( this, 0, info, COLLISION_GROUP_INTERACTIVE_DEBRIS, true );
|
CBaseEntity *pRagdoll = CreateServerRagdoll( this, 0, info, COLLISION_GROUP_INTERACTIVE_DEBRIS, ShouldFadeServerRagdolls() );
|
||||||
|
|
||||||
pRagdoll->SetCollisionBounds( CollisionProp()->OBBMins(), CollisionProp()->OBBMaxs() );
|
pRagdoll->SetCollisionBounds( CollisionProp()->OBBMins(), CollisionProp()->OBBMaxs() );
|
||||||
|
|
||||||
@ -1690,7 +1699,7 @@ bool CBaseCombatCharacter::BecomeRagdoll( const CTakeDamageInfo &info, const Vec
|
|||||||
#endif
|
#endif
|
||||||
// in single player create ragdolls on the server when the player hits someone
|
// in single player create ragdolls on the server when the player hits someone
|
||||||
// with their vehicle - for more dramatic death/collisions
|
// with their vehicle - for more dramatic death/collisions
|
||||||
CBaseEntity *pRagdoll = CreateServerRagdoll( this, m_nForceBone, info2, COLLISION_GROUP_INTERACTIVE_DEBRIS, true );
|
CBaseEntity *pRagdoll = CreateServerRagdoll( this, m_nForceBone, info2, COLLISION_GROUP_INTERACTIVE_DEBRIS, ShouldFadeServerRagdolls() );
|
||||||
FixupBurningServerRagdoll( pRagdoll );
|
FixupBurningServerRagdoll( pRagdoll );
|
||||||
RemoveDeferred();
|
RemoveDeferred();
|
||||||
return true;
|
return true;
|
||||||
@ -1704,7 +1713,7 @@ bool CBaseCombatCharacter::BecomeRagdoll( const CTakeDamageInfo &info, const Vec
|
|||||||
// Burning corpses are server-side in episodic, if we're in darkness mode
|
// Burning corpses are server-side in episodic, if we're in darkness mode
|
||||||
if ( IsOnFire() && HL2GameRules()->IsAlyxInDarknessMode() )
|
if ( IsOnFire() && HL2GameRules()->IsAlyxInDarknessMode() )
|
||||||
{
|
{
|
||||||
CBaseEntity *pRagdoll = CreateServerRagdoll( this, m_nForceBone, newinfo, COLLISION_GROUP_DEBRIS );
|
CBaseEntity *pRagdoll = CreateServerRagdoll( this, m_nForceBone, newinfo, COLLISION_GROUP_DEBRIS, ShouldFadeServerRagdolls() );
|
||||||
FixupBurningServerRagdoll( pRagdoll );
|
FixupBurningServerRagdoll( pRagdoll );
|
||||||
RemoveDeferred();
|
RemoveDeferred();
|
||||||
return true;
|
return true;
|
||||||
@ -1725,7 +1734,7 @@ bool CBaseCombatCharacter::BecomeRagdoll( const CTakeDamageInfo &info, const Vec
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//FIXME: This is fairly leafy to be here, but time is short!
|
//FIXME: This is fairly leafy to be here, but time is short!
|
||||||
CBaseEntity *pRagdoll = CreateServerRagdoll( this, m_nForceBone, newinfo, COLLISION_GROUP_INTERACTIVE_DEBRIS, true );
|
CBaseEntity *pRagdoll = CreateServerRagdoll( this, m_nForceBone, newinfo, COLLISION_GROUP_INTERACTIVE_DEBRIS, ShouldFadeServerRagdolls() );
|
||||||
FixupBurningServerRagdoll( pRagdoll );
|
FixupBurningServerRagdoll( pRagdoll );
|
||||||
PhysSetEntityGameFlags( pRagdoll, FVPHYSICS_NO_SELF_COLLISIONS );
|
PhysSetEntityGameFlags( pRagdoll, FVPHYSICS_NO_SELF_COLLISIONS );
|
||||||
RemoveDeferred();
|
RemoveDeferred();
|
||||||
@ -1735,7 +1744,7 @@ bool CBaseCombatCharacter::BecomeRagdoll( const CTakeDamageInfo &info, const Vec
|
|||||||
|
|
||||||
if( hl2_episodic.GetBool() && Classify() == CLASS_PLAYER_ALLY_VITAL )
|
if( hl2_episodic.GetBool() && Classify() == CLASS_PLAYER_ALLY_VITAL )
|
||||||
{
|
{
|
||||||
CreateServerRagdoll( this, m_nForceBone, newinfo, COLLISION_GROUP_INTERACTIVE_DEBRIS, true );
|
CreateServerRagdoll( this, m_nForceBone, newinfo, COLLISION_GROUP_INTERACTIVE_DEBRIS, ShouldFadeServerRagdolls() );
|
||||||
RemoveDeferred();
|
RemoveDeferred();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -350,6 +350,8 @@ public:
|
|||||||
// A version of BecomeRagdollBoogie() that allows the color to change and returns the entity itself instead.
|
// A version of BecomeRagdollBoogie() that allows the color to change and returns the entity itself instead.
|
||||||
// In order to avoid breaking anything, it doesn't change the original function.
|
// In order to avoid breaking anything, it doesn't change the original function.
|
||||||
virtual CBaseEntity *BecomeRagdollBoogie( CBaseEntity *pKiller, const Vector &forceVector, float duration, int flags, const Vector *vecColor );
|
virtual CBaseEntity *BecomeRagdollBoogie( CBaseEntity *pKiller, const Vector &forceVector, float duration, int flags, const Vector *vecColor );
|
||||||
|
|
||||||
|
bool ShouldFadeServerRagdolls() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CBaseEntity *FindHealthItem( const Vector &vecPosition, const Vector &range );
|
CBaseEntity *FindHealthItem( const Vector &vecPosition, const Vector &range );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user