mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-01-05 17:13:36 +08:00
Update CTakeDamageInfo from 2013 sdk.
This commit is contained in:
parent
8c64091457
commit
7bbdf7da22
@ -57,10 +57,10 @@ void CTakeDamageInfo::Init( CBaseEntity *pInflictor, CBaseEntity *pAttacker, CBa
|
|||||||
m_vecDamagePosition = damagePosition;
|
m_vecDamagePosition = damagePosition;
|
||||||
m_vecReportedPosition = reportedPosition;
|
m_vecReportedPosition = reportedPosition;
|
||||||
m_iAmmoType = -1;
|
m_iAmmoType = -1;
|
||||||
|
|
||||||
m_iDamagedOtherPlayers = 0;
|
m_iDamagedOtherPlayers = 0;
|
||||||
m_iPlayerPenetrateCount = 0;
|
m_iPlayerPenetrationCount = 0;
|
||||||
m_flUnknown = 0.0f;
|
m_flDamageBonus = 0.f;
|
||||||
|
m_bForceFriendlyFire = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CTakeDamageInfo::CTakeDamageInfo()
|
CTakeDamageInfo::CTakeDamageInfo()
|
||||||
@ -245,6 +245,11 @@ void AddMultiDamage( const CTakeDamageInfo &info, CBaseEntity *pEntity )
|
|||||||
g_MultiDamage.SetMaxDamage( MAX( g_MultiDamage.GetMaxDamage(), info.GetDamage() ) );
|
g_MultiDamage.SetMaxDamage( MAX( g_MultiDamage.GetMaxDamage(), info.GetDamage() ) );
|
||||||
g_MultiDamage.SetAmmoType( info.GetAmmoType() );
|
g_MultiDamage.SetAmmoType( info.GetAmmoType() );
|
||||||
|
|
||||||
|
if ( g_MultiDamage.GetPlayerPenetrationCount() == 0 )
|
||||||
|
{
|
||||||
|
g_MultiDamage.SetPlayerPenetrationCount( info.GetPlayerPenetrationCount() );
|
||||||
|
}
|
||||||
|
|
||||||
bool bHasPhysicsForceDamage = !g_pGameRules->Damage_NoPhysicsForce( info.GetDamageType() );
|
bool bHasPhysicsForceDamage = !g_pGameRules->Damage_NoPhysicsForce( info.GetDamageType() );
|
||||||
if ( bHasPhysicsForceDamage && g_MultiDamage.GetDamageType() != DMG_GENERIC )
|
if ( bHasPhysicsForceDamage && g_MultiDamage.GetDamageType() != DMG_GENERIC )
|
||||||
{
|
{
|
||||||
|
@ -77,6 +77,8 @@ public:
|
|||||||
void SetDamageCustom( int iDamageCustom );
|
void SetDamageCustom( int iDamageCustom );
|
||||||
int GetDamageStats( void ) const;
|
int GetDamageStats( void ) const;
|
||||||
void SetDamageStats( int iDamageStats );
|
void SetDamageStats( int iDamageStats );
|
||||||
|
void SetForceFriendlyFire( bool bValue ) { m_bForceFriendlyFire = bValue; }
|
||||||
|
bool IsForceFriendlyFire( void ) const { return m_bForceFriendlyFire; }
|
||||||
|
|
||||||
int GetAmmoType() const;
|
int GetAmmoType() const;
|
||||||
void SetAmmoType( int iAmmoType );
|
void SetAmmoType( int iAmmoType );
|
||||||
@ -123,6 +125,7 @@ protected:
|
|||||||
int m_iDamagedOtherPlayers;
|
int m_iDamagedOtherPlayers;
|
||||||
int m_iPlayerPenetrationCount;
|
int m_iPlayerPenetrationCount;
|
||||||
float m_flDamageBonus; // Anything that increases damage (crit) - store the delta
|
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();
|
DECLARE_SIMPLE_DATADESC();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user