diff --git a/game/shared/takedamageinfo.cpp b/game/shared/takedamageinfo.cpp index be3d7c0f..70037f84 100644 --- a/game/shared/takedamageinfo.cpp +++ b/game/shared/takedamageinfo.cpp @@ -57,10 +57,10 @@ void CTakeDamageInfo::Init( CBaseEntity *pInflictor, CBaseEntity *pAttacker, CBa m_vecDamagePosition = damagePosition; m_vecReportedPosition = reportedPosition; m_iAmmoType = -1; - m_iDamagedOtherPlayers = 0; - m_iPlayerPenetrateCount = 0; - m_flUnknown = 0.0f; + m_iPlayerPenetrationCount = 0; + m_flDamageBonus = 0.f; + m_bForceFriendlyFire = false; } CTakeDamageInfo::CTakeDamageInfo() @@ -245,6 +245,11 @@ void AddMultiDamage( const CTakeDamageInfo &info, CBaseEntity *pEntity ) g_MultiDamage.SetMaxDamage( MAX( g_MultiDamage.GetMaxDamage(), info.GetDamage() ) ); g_MultiDamage.SetAmmoType( info.GetAmmoType() ); + if ( g_MultiDamage.GetPlayerPenetrationCount() == 0 ) + { + g_MultiDamage.SetPlayerPenetrationCount( info.GetPlayerPenetrationCount() ); + } + bool bHasPhysicsForceDamage = !g_pGameRules->Damage_NoPhysicsForce( info.GetDamageType() ); if ( bHasPhysicsForceDamage && g_MultiDamage.GetDamageType() != DMG_GENERIC ) { diff --git a/game/shared/takedamageinfo.h b/game/shared/takedamageinfo.h index 5740e356..0ba29108 100644 --- a/game/shared/takedamageinfo.h +++ b/game/shared/takedamageinfo.h @@ -77,6 +77,8 @@ public: void SetDamageCustom( int iDamageCustom ); int GetDamageStats( void ) const; void SetDamageStats( int iDamageStats ); + void SetForceFriendlyFire( bool bValue ) { m_bForceFriendlyFire = bValue; } + bool IsForceFriendlyFire( void ) const { return m_bForceFriendlyFire; } int GetAmmoType() const; void SetAmmoType( int iAmmoType ); @@ -123,6 +125,7 @@ protected: int m_iDamagedOtherPlayers; int m_iPlayerPenetrationCount; float m_flDamageBonus; // Anything that increases damage (crit) - store the delta + bool m_bForceFriendlyFire; // Ideally this would be a dmg type, but we can't add more DECLARE_SIMPLE_DATADESC(); };